Skip to content

fix(settings): preserve edits made during save - #96

Open
kaluli123123 wants to merge 1 commit into
otty-shell:mainfrom
kaluli123123:agent/settings-save-race
Open

fix(settings): preserve edits made during save#96
kaluli123123 wants to merge 1 commit into
otty-shell:mainfrom
kaluli123123:agent/settings-save-race

Conversation

@kaluli123123

Copy link
Copy Markdown
Contributor

Summary

  • preserve draft edits made while a settings save is in flight
  • serialize saves so concurrent tasks cannot race on the same settings file
  • allow retries after failed saves

Root cause

A save completion replaced the entire settings state with the snapshot written to disk. If the user edited another field before the asynchronous save completed, that newer draft was silently overwritten.

The state now tracks edit and save revisions. A completion updates the persisted baseline while retaining a newer draft.

Verification

  • the regression test failed before the implementation and passes after it
  • settings reducer tests: 10 passed
  • settings state tests: 29 passed
  • cargo +nightly fmt
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo deny check
  • cargo test --workspace --all-features: 528 passed, 2 ignored
  • cargo llvm-cov --workspace --all-features --fail-under-lines 80: all tests passed on the repeat run; repository line coverage is 67.79%, below the existing 80% gate

Notes

The first coverage run exposed the pre-existing double-click timing flake fixed separately. cargo deny reports the existing yanked transitive dependencies core2 0.4.0 and spin 0.9.8.

@kaluli123123

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please focus on asynchronous save ordering, stale completions, and retry behavior.

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