LiveSplit / LiveSplit/livesplit-core

HotkeySystem set_config conflict merges badly

Open
#815 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
227
Forks
81
Avg merge
22h 45m
Merged PRs (30d)
3

Description

If a `HotkeySystem` starts out with the default bindings, and then `set_config` is used to replace those with new bindings, it behaves badly when one of those new bindings conflicts with one of the old bindings.

Old bindings:
```
Split Numpad 1
Reset Numpad 3
Undo Numpad 8
Skip Numpad 2
Pause Numpad 5

PrevCmp Numpad 4
NextCmp Numpad 6
```

New bindings:
```
Split Numpad 0
Reset Numpad 7
Undo Numpad 4
Skip Numpad 1
Pause Pause Break
```

When it goes to set `Undo` to `Numpad 4`, it still sets that in the config, but then signals a failure that leaves the old bindings from `Skip` onward in place to result in

Badly-merged bindings:
```
Split Numpad 0
Reset Numpad 7
Undo Numpad 4
Skip Numpad 2
Pause Numpad 5

PrevCmp Numpad 4
NextCmp Numpad 6
```
With a conflict between `Undo` and `PrevCmp` staying in the config because it didn't go on to set `PrevCmp` to None.

My desired behavior would be to un-register the conflicting `PrevCmp` binding before it registers the new `Undo` binding as `Numpad 4`.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at HotkeySystem::set_config and trace how conflicting bindings are handled while applying the new configuration. Verify the behavior with the reported old and new bindings; done means the conflicting PrevCmp binding is unregistered before Undo takes Numpad 4, without leaving a partially merged configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.