Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 62d5fd17ce
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| state.current.path === currentPath && | ||
| state.current.data === currentData | ||
| state.current.saveChain === queuedSave | ||
| ) { |
There was a problem hiding this comment.
Preserve dirty state until latest snapshot is persisted
In useDataFileCore's throttled saveData, this completion guard now checks saveChain instead of whether state.current.data still matches the snapshot being written. With throttle(..., { leading: true, trailing: true }), a second updateData inside the 500ms window marks the state dirty but does not run saveData immediately; if the first write finishes before the trailing call, this condition sets state back to saved, and the trailing invocation then returns early at the state === 'saved' check, dropping the newer update from disk.
Useful? React with 👍 / 👎.
Attempt to add a bit more robust file writing, and debug issues occurring on windows