Repository navigation
fix(persistence): retry pending saves after read failures - #426
Merged
Merged
Conversation
…rnings Saves that failed to read data.json should retry once the file reads again, and a failed import or API key save should show only its own Notice.
…ilures to their caller A save that could not read data.json now retries at the checkpoint interval while an edit or failed write is pending, so the next good read lifts the refusal and writes. Strict saves leave reporting a failed write to their caller, and a retry that finds the failed write already on disk writes nothing more.
…eak quiet A read can rebuild entries the file dropped from what PodNotes last wrote, so matching a failed write does not prove the file holds it. Saves now write it again instead of returning early, and whether a failed write warns is decided before the read settles it, so the retry adds no generic Notice to a streak already reported.
Deploying podnotes with
|
| Latest commit: |
cb8d43e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://afda0ab4.podnotes.pages.dev |
| Branch Preview URL: | https://fix-retry-after-read-failure.podnotes.pages.dev |
This was referenced Oct 13, 2026
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.
Summary
A temporary pre-write read failure could strand unsaved changes even after the disk recovered. Pending saves now retry on the existing 10-second schedule, so a successful read clears the refusal and saves them. Idle writes stay at zero.
Failed imports and API-key selections show only their caller-specific Notice, including through retry failures. The existing window-unload test now requires no Notice and no retry timer. Production changes are confined to
writer.ts; F2 is excluded.Detection and retention already existed in f7400ba. All 75 baseline persistence tests pass on master; this follow-up adds recovery from read failures and fixes duplicate Notices. Refs #425 and #385 (already closed).
Verification
npm run lint,npm run format:check,npm run typecheck,npm run build,npm run test: passed, 1,736 application tests; both Svelte checks have zero errors/warnings.npm run test:tooling: 10 passed.npm run docs:build: 18 pages, valid links and 112 legacy fragments.npm run size: 285,447 raw / 90,856 gzip bytes, +109 / +40 versus master.npm run test:e2e: 77 passed across 12 files. An earlier attempt was interrupted for a review correction; all final gates and live probes were rerun afterward.npm run count:writes: master and branch match exactly, zero idle writes and two completed writes / 3,966 bytes in the same Settings flow. Failed-import live probe shows only the specific Notice on the branch.Release impact
No schema, settings shape, encoding boundary, public API, or migration changes.
Docs at release
Document automatic recovery from temporary read failures and the single caller-specific Notice for failed settings import or API-key selection saves.
Note
Retry pending persistence saves in
DataFileWriter.persistafter read failuresDataFileWriter.persistnow schedules a checkpoint retry when a failed write or unsaved edits exist, then rethrows the error. Pending edits are saved once the file becomes readable again (writer.ts).Macroscope summarized cb8d43e.