Skip to content

Reply archive: a failed storage write loses that pass and is reported as saved #66

Closed

Description

@wolfgang-aura

Impact: a reply-probe pass saves the archive up to three times: after capture, after seeding, and after gap recovery. Each store.save reloads the stored archive and merges. When one write fails (quota, IndexedDB error), it returns { ok: false, records: merged }, but the next save reloads the older stored copy. The failed write's replies are lost. result.archiveStorageError comes from the last save only, which succeeded, so no error toast appears. This is the silent failure the IndexedDB move was meant to prevent.

The probe-history write has the same gap. writeReplyProbeResult puts a localStorage failure in result.storageError, which nothing reads, and the finish toast always says "Result saved locally."

Where: sourcecapsule.user.js: the three getReplyArchiveStore().save(...) calls in runReplyProbe (~10633-10680), save in createReplyArchiveStore (~9867-9915), writeReplyProbeResult (9389-9400), finish toast (10740).

Evidence: Node repro with an adapter whose first set() throws and later writes succeed: archiveStorageError is "", and the 5 replies from the failed save are absent from the stored archive. With a 60000-unit localStorage quota, the history write fails and no toast mentions it.

Related to #19 (closed), which fixed the failed-load path. This is the failed-write path.

Environment: main 72777ef (v1.6.8). Engine loaded in Node through the module.exports guard, storage adapters stubbed. No browser.

Next action: within one pass, merge into the in-memory result of the previous save instead of reloading, or stop the pass at the first failed write. Combine the storage errors from all saves into the result, and surface storageError in the finish toast.

Activity

  1. wolfgang-aura commented on Oct 7, 2026

    @wolfgang-aura
    OwnerAuthor

    Fixed in 5ec466b (PR #73). Released in v1.6.9 (main fe4d3f1); userscript installs update from main. Verified by a regression test in test/dom.test.mjs that fails on v1.6.8; npm test and CI pass. Not yet live-verified on X.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions