Skip to content

fix: prevent lost updates in concurrent persistence - #188

Closed
tuberkulez-takt wants to merge 1 commit into
RykoTheDev:mainfrom
tuberkulez-takt:fix/persist-read-write-race
Closed

tuberkulez-takt wants to merge 1 commit into
RykoTheDev:mainfrom
tuberkulez-takt:fix/persist-read-write-race

Conversation

@tuberkulez-takt

Copy link
Copy Markdown
Contributor

Blocking operations should be handled via spawn_blocking, meaning the calls run in parallel on the Tokio pool. persist::write_json_with_backup uses a "write-to-temp-then-rename" strategy; this prevents corrupted JSON but does not protect against lost updates—where two parallel sequences of read(old) followed by write(A) and write(B) result in the last write winning.
https://docs.rs/tauri/latest/tauri/struct.State.html

fix2_problem_bw

Fix concurrent read-modify-write races that can cause persisted project, settings, category, or workspace data to be overwritten by a concurrent writer.
@RykoTheDev

RykoTheDev commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

please do disclose if you use AI assistance or Vibe coded. its not banned but its required to disclose it. and please do fix the conflicts. i did merged ur other two PRs for now

@RykoTheDev

Copy link
Copy Markdown
Owner

Hi again, this PR will be closed if I receive no reply within 2 more days.

@RykoTheDev RykoTheDev closed this Sep 27, 2026
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.

2 participants