Skip to content

fix(parser): restore default key mappings on clear#2012

Merged
jtroo merged 1 commit intojtroo:mainfrom
FlameFlag:flameflag/push-uwuymvowsmtm
Apr 9, 2026
Merged

fix(parser): restore default key mappings on clear#2012
jtroo merged 1 commit intojtroo:mainfrom
FlameFlag:flameflag/push-uwuymvowsmtm

Conversation

@FlameFlag
Copy link
Copy Markdown
Contributor

Describe your changes. Use imperative present tense.

clear_custom_str_oscode_mapping wipes the global string-to-OsCode map including defaults like ';' -> KEY_SEMICOLON, then releases the lock before parse_cfg calls replace_custom_str_oscode_mapping to re-add them. Concurrent str_to_oscode callers in parallel tests can observe the gap and fail to resolve literal punctuation keys, surfacing as a flaky 'unknown key' error on slower CI runners

Re-install the defaults inside clear_custom_str_oscode_mapping under the same lock so the global never has a default-less window

Checklist

  • Add documentation to docs/config.adoc
    • N/A
  • Add example and basic docs to cfg_samples/kanata.kbd
    • N/A
  • Update error messages
    • N/A
  • Added tests, or did manual testing
    • N/A

clear_custom_str_oscode_mapping wipes the global string-to-OsCode map
including defaults like ';' -> KEY_SEMICOLON, then releases the lock
before parse_cfg calls replace_custom_str_oscode_mapping to re-add
them. Concurrent str_to_oscode callers in parallel tests can observe the
gap and fail to resolve literal punctuation keys, surfacing as a flaky
'unknown key' error on slower CI runners

Re-install the defaults inside clear_custom_str_oscode_mapping under the
same lock so the global never has a default-less window
@jtroo jtroo merged commit 7625e2c into jtroo:main Apr 9, 2026
5 checks passed
@FlameFlag FlameFlag deleted the flameflag/push-uwuymvowsmtm branch April 9, 2026 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants