Conversation
|
it would be better to actual raise an issue and then link a PR with the fix to the issue. Folks who come search for similar problems will most likely search in the issues rather than past PRs. |
|
Based on the description I assume this is LLM generated. |
|
Hi @svartkanin! Sorry for the LLM jump scare 😄 Now on replication, the best way is to :
Once you get the hang of it, it's easy to replicate. 2 key things I have noticed :
The reason for the bugs I think is due to the event handler always assuming that the SelectionList is present in the DOM whenever an event fires, so it just throws the To fix that my |
|
Thanks for the explanation I was able to replicate it and confirm the fix |
|
The mypy check is failing |
This comment was marked as outdated.
This comment was marked as outdated.
|
I've kept on digging on this issue, trying to fix those To fix this issue I added a slight delay between each of the operations and also refactored the code to fire the operations only on batches of keystrokes. The delay is minimal, at 60ms (best performance I found while testing), and can be tuned later if needed. |
Problem :
If a keystroke arrives during
SelectionListtransition or screen dismissal, an unhandledNoMatchesexception is thrown, causingarchinstallto crash:Replication :
Additional packagesmenu.backspacewhen the menu is transitioning.Reasons for the problem I figured :
NoMatchesexception ifSelectionListis not visible in DOM. (First assumption)Additional packagesI figured that the main reason for the crash could have been the_update_options(...)being called over every single keystroke, which did the entire search cycle offiltering-->sorting-->widgeton every key press by calling_group.get_focused_index(...).Which is expensive on larger lists and due to keystrokes overlapping the cycle queries the system crashed.
note : This issue was already marked in the
menu_item.pybut I think was never guarded against.Fix :
query_onecalls on key events._update_optionsby adding a slight delay (60ms, was found to be best in testing) on the event inon_input_changed. The delay is minuscule and doesn't really affect the overall UI experience.