Repository navigation
Conversation
Writers replace magnifier.ini atomically, but around each MoveFileEx the name briefly refuses opens (measured: ~1% of reads during a burst of replaces failed with ERROR_ACCESS_DENIED). LoadConfig treated that as a missing file and wrote the defaults over the user's ini; read-modify-write callers got "" from ReadTextFile. Field: a tray Night light drag mid-zoom unbound the zoom keys (stuck zoom) and set onboarded=0 (setup at the next start). - ReadTextFileOk / WriteTextFileAtomic retry sharing and access errors until a deadline (250 ms; the tick thread reads with 20 ms), and reads share delete. - LoadConfig creates the defaults only for a missing file; TryLoadConfig reports failure. - The hot-reload keeps the running settings on an unreadable ini and re-checks next poll. - ReadLiveIni guards the read-modify-write writers (settings app, tray, profile seed). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011zPmivSAQeivGUdBjTsaMu
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.
Closes #377.
What happened
Dragging the tray's Night light slider while zoomed left the zoom stuck, and the next start opened the first-launch setup. The core had reloaded the factory defaults: zoom buttons unbound,
onboarded=0.Cause
Writers replace
magnifier.iniatomically, but around eachMoveFileExWthe name briefly refuses opens. Measured on the dev PC: ~1% of reads during a burst of replaces failed withERROR_ACCESS_DENIED.LoadConfigtook a failed open for a missing file and wrote the defaults over the user's ini.ReadTextFilereturned""to read-modify-write callers.Fix
ReadTextFileOkandWriteTextFileAtomicretry sharing and access errors until a deadline: 250 ms by default, 20 ms on the core's tick thread. Reads now share delete, so they never block a replace.LoadConfigwrites the defaults only for a missing file.TryLoadConfigreports an unreadable one.config ini unreadable on reload). A deleted ini is still recreated.ReadLiveIniguards the read-modify-write writers:setConfig, profile rename/switch (settings app and tray), the engine revert and the first-run profile seed.Verification
build.bat checkandbuild.bat trayare clean (only pre-existing warnings).C:\REharnessini_lock_test.py): change the ini, then hold it open with no sharing for 1.5 s, zooming in and out during and after the lock.inHeld). This is the field symptom.ini unreadablewarning, the zoom works during the lock (press to tick 0.08 ms, no stall) and after, and the ini is intact.ini_race_test.py): 870 read-modify-write replaces in 25 s while zooming. The ini kept every key, all zoom cycles worked, and no writes failed.Not version-bumped: develop PRs ride the bump that comes with the develop to main merge.
🤖 Generated with Claude Code
https://claude.ai/code/session_011zPmivSAQeivGUdBjTsaMu