You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: run spell-check pass on main thread to eliminate data races
Background-queue approaches had two fatal flaws on macOS 15.x:
1. requestChecking(of:…) completion handler sometimes never fired
after the first call, leaving cache permanently empty.
2. DispatchQueue.global approach read textView.string (not thread-
safe) and called shouldSuppressSpellMark which accesses
cachedParsedDocument — a property the main thread mutates during
restyles. This data race silently produced empty results after
edits (underlines disappeared and never returned on insert).
Run the entire checkSpelling(of:startingAt:) walk synchronously on
the main thread. For typical notes (hundreds of words, a handful of
misspellings) this takes single-digit milliseconds — well within the
400ms debounce window. Eliminates all threading issues.
0 commit comments