Repository navigation
fix(windows): prevent stale async settings replies from reverting selected list - #40
Merged
Merged
Conversation
turinglambdaai
force-pushed
the
fix/windows-settings-async-stale-state
branch
from
October 21, 2026 03:20
d16ca7f to
8f501d3
Compare
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.
Problem
Windows
SaveSettingAsync(key, value)runs after the UI has already applied a user's language, theme or selected-list change. When its asyncset_settingRPC completes, it unconditionally replaces the entire localsettings_object with the response. If the user changes lists or themes while another save is running, an older response can roll back the newer locallast_selected_list_id(or language/theme) even though the UI remains on the newly selected list. This can cause incorrect selection restored on a later database open or after relaunch.Change
Treat set-setting responses as persistence acknowledgements only. Still call
result.get()to surface errors, but stop overwriting the full local state in the async success callback. All current callers already set the relevant local state synchronously before submitting the RPC. Document this cross-platform contract.Verification
get_settingsRPCIndependent of #32–#39 (changes only
SaveSettingAsyncand spec); run combined integration after merging. No merge/release until validation.