bluetui icon indicating copy to clipboard operation
bluetui copied to clipboard

index out of bounds

Open mattkang opened this issue 11 months ago • 4 comments

thread 'main' panicked at /build/qmlvz394sva1rawai3r4xfjww5d0jpni-source/src/handler.rs:684:74:
index out of bounds: the len is 9 but the index is 10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This error occurred when I did the following:

  1. Scan for devices. Let the list populate with several devices.
  2. Stop scanning.
  3. Wait for some devices to ~~fall off~~ depopulate from the list of scanned devices. (Not sure if this is expected behaviour.)
  4. Attempt to connect to one of the devices that still remain (mine happened to be toward the end of the list)

mattkang avatar Dec 16 '24 16:12 mattkang

What do you mean Wait for some devices to fall off Can you explain the whole process more in details ?

pythops avatar Dec 16 '24 16:12 pythops

@pythops edited the text. Happy to provide more detail as directed. It's my hunch that either devices are not intended to depopulate when scanning is stopped and/or this event is not being caught with indexing logic.

mattkang avatar Dec 16 '24 16:12 mattkang

I could reproduce it. Thanks for reporting it. I will look at it :eyes:

pythops avatar Dec 17 '24 04:12 pythops

To fix this one will require some refactoring and restructuring of the app, which I will do for sure. I will release a new version now cause some users are waiting for some changes and then I will focus on this interesting bug.

pythops avatar Dec 21 '24 13:12 pythops