Skip to content

Load lookup data without racing or crashing; finish engine setup in the constructor - #613

Open
EzeriumChristinal wants to merge 3 commits into
BambooEngine:masterfrom
EzeriumChristinal:audit/load-robustness
Open

EzeriumChristinal wants to merge 3 commits into
BambooEngine:masterfrom
EzeriumChristinal:audit/load-robustness

Conversation

@EzeriumChristinal

Copy link
Copy Markdown

Part of a stack with "Give each engine its own key queue; serialize engine state" — merge in that order.

FocusIn filled the shared emoji trie and dictionary with no synchronization and panicked the daemon if the emoji file was missing. Construction also left the emoji engine and macro table nil until async init ran, so an early event could nil-deref.

Both tables now publish immutably once loaded; a failed load logs and leaves the feature off. The constructor builds emoji, macros, and the queue synchronously. Config-file setup returns errors instead of panicking.

Smaller fixes on the same paths: UsIM-default engines honor per-window mappings to Vietnamese modes; last-character compares use runes for custom input methods with multi-byte keys; empty input no longer panics macro-case detection; the dictionary reader reports scan errors; macro table access is locked and its file watcher starts once.

Tests: macro-case, emoji bounds, UsIM mapping, concurrent macro access.

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.

1 participant