Repository navigation
fix(persistence): rearm read retries for later edits - #433
Merged
Merged
Conversation
…g pending Undoing every pending edit during a read outage, or rolling back an import whose save could not read data.json, stops the read retry. Edits made once the file reads again never reach disk. Both routes fail on the current writer. The unload test now also covers a refused background write, which must show no failure Notice, and the startup refusal test attaches its writer after loading, as onload does.
…its are undone While data.json could not be read at runtime, saveSettings dropped every request, and only the writer's read retry could lift the refusal. That retry stopped once nothing was pending, as after undoing every edit or rolling back a failed import, so edits made after the file read again stayed in memory and were lost on quit. saveSettings now hands a request under that refusal to the writer's new retryPending, which arms the existing checkpoint retry when a loaded file has pending work. The retry keeps its 10 s spacing, arms nothing while nothing is pending, and still arms nothing under the startup refusal, before any file was loaded. The other refusals still drop requests.
Deploying podnotes with
|
| Latest commit: |
34c910f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e46acbe2.podnotes.pages.dev |
| Branch Preview URL: | https://fix-rearm-read-retry.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
After a temporary read outage, reverting the last edit or rolling back a failed import could stop retries permanently. Later edits stayed in memory and were lost on quit, even after the disk recovered.
Background edits now re-arm the existing retry only under the runtime unreadable-file refusal, with a loaded document and pending work. Startup refusals stay blocked, idle writes stay at zero, and attempts retain the 10-second cadence. The refused-background-save test now catches the surviving Notice mutation, and the failed-read catch explains why it retries.
Refs #426. Deferred schema retries and the missing newer-schema Notice are tracked in #429. Strict import/API-key recovery is tracked in #430. Review also identified existing visibility-flush and startup-Notice cases, filed as #431 and #432. These stay outside this final persistence PR.
Verification
count:writesmatches master exactly (two writes, 3966 bytes).npm run lint,npm run format:check,npm run typecheck,npm run build,npm run test,npm run test:tooling,npm run docs:build,npm run test:e2e, andnpm run size: all passed. Application tests: 1740; tooling: 10; E2E: 77 (one full run, Obsidian 1.14.4/Linux). Final bundle: 285622 raw / 90884 gzip bytes, +175 / +28 versus master.The screenshots show memory at 33 in both versions. The linked probe logs verify the persisted values.
Release impact
No schema, settings shape, encoding boundary, API, or migration changes.
Docs at release
Document that a new Settings edit resumes saves after a temporary read outage, including when earlier edits were reverted or an import was rolled back.
Note
Rearm persistence retries for edits after a failed data.json read
DataFileWriter.retryPendingin writer.ts, which schedules a checkpoint retry when a readable base document exists and a failed write or unsaved edits are pending. It does nothing before a file is loaded or when nothing is pending.PodNotes.saveSettingsin main.ts now callsretryPendingwhen the refusal reason isunreadable-data-file. Other refusal reasons still do not retry.retryPendingcalls coalesce into one timer, which writes only the latest in-memory value at the checkpoint deadline.Macroscope summarized 34c910f.