-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Fix: Fixed ArgumentException in CommandManager.OverwriteKeyBindings #15582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Fixed ArgumentException in CommandManager.OverwriteKeyBindings #15582
Conversation
hishitetsu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Crashes can be avoided, but changing duplicate key assignments from the settings doesn't seem to be saved.
|
I want to reset them in json too then |
|
This can only happen by editing the configuration file directly, so I think it is fine to leave it as it is if avoiding crashes is enough. |
|
I mean, instead of using default ones, I'd like to reset in json first and reload. What do you think? Losing user data without notice would be bad but this reload happens before MainPage loaded, meaning dialog cannot be shown. |
I don't think it is a good idea, unless structure of the json is broken. |
|
Okay, I’ll just fix |
|
It seems that the app no longer starts when there is a duplicate key. |
|
Proven I’m bad at bug fix. |
hishitetsu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirmed it works. LGTM
|
What solution did we end up going with? |
|
If there are any custom hotkeys that duplicate other hotkeys, they are removed from the json and restored to default. |
|
Thank you @0x5bfa and @hishitetsu for your work on this fix! |
Summary
The fix is basically to catch exceptions and use default keys for commands that have the same key(if other exception than ArgumentException the app uses the default keys for all commands).
Resolved / Related Issues
To prevent extra work, all changes to the Files codebase must link to an approved issue marked as
Ready to build. Please insert the issue number following the hashtag with the issue number that this Pull Request resolves.Steps used to test these changes
Stability is a top priority for Files and all changes are required to go through testing before being merged into the repo. Please include a list of steps that you used to test this PR.
Used this to test