Load lookup data without racing or crashing; finish engine setup in the constructor - #613
Open
EzeriumChristinal wants to merge 3 commits into
Open
EzeriumChristinal wants to merge 3 commits into
EzeriumChristinal wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.