saveStateOnce() in src/shared/state.js set its baseline (what the next save compares against) from the page's state after the write. A change made while that save waited on storage went into the baseline but not into storage, so the save queued after the change found nothing to write.
Fix: the save copies the page's fields when it starts, writes from that copy and keeps the same copy as the baseline, so anything changed after the copy still differs from the baseline, for every field, the merged ones included.
What next loses (checked with tests):
A setting such as networkId changed during the earlier save's read or write.
A wallet added during the earlier save's write is dropped from storage, encrypted secret included. The popup shows it until reopened; then it is gone.
During the write, an origin revoked in allowedSites stays allowed in storage, a deniedSites or networkEndpoints change is lost, and a deleted wallet stays stored. During the read these were already written, because the save shared the page's live objects.
The networkId test and the wallet-added-during-write test in tests/stateMerge.test.js fail against current next.
Deviation: the brief's wallet-added-during-the-read case already passed on next; its test only guards the fix.
Behaviour change: a change made during the read is now stored by the save queued after it, not by the earlier save.
Unverified in shipped tests: sites, endpoints and wallet deletion were checked with throwaway tests, not committed.
README.md describes nothing this changes; no edit.
Model: opus-5-5
`saveStateOnce()` in `src/shared/state.js` set its baseline (what the next save compares against) from the page's state after the write. A change made while that save waited on storage went into the baseline but not into storage, so the save queued after the change found nothing to write.
**Fix:** the save copies the page's fields when it starts, writes from that copy and keeps the same copy as the baseline, so anything changed after the copy still differs from the baseline, for every field, the merged ones included.
**What `next` loses** (checked with tests):
- A setting such as `networkId` changed during the earlier save's read or write.
- **A wallet added during the earlier save's write is dropped from storage, encrypted secret included.** The popup shows it until reopened; then it is gone.
- During the write, an origin revoked in `allowedSites` stays allowed in storage, a `deniedSites` or `networkEndpoints` change is lost, and a deleted wallet stays stored. During the read these were already written, because the save shared the page's live objects.
The `networkId` test and the wallet-added-during-write test in `tests/stateMerge.test.js` fail against current `next`.
- Deviation: the brief's wallet-added-during-the-read case already passed on `next`; its test only guards the fix.
- Behaviour change: a change made during the read is now stored by the save queued after it, not by the earlier save.
- Unverified in shipped tests: sites, endpoints and wallet deletion were checked with throwaway tests, not committed.
- `README.md` describes nothing this changes; no edit.
Model: opus-5-5
saveStateOnce() took its baseline from the page's state after the write, so
a change made while the save waited on storage counted as already stored and
the save queued after it wrote nothing. A setting changed during the read was
lost, and so was a wallet added, a site revoked or an endpoint changed during
the write. The save now copies the page's fields when it starts, writes from
that copy, and keeps the copy as the baseline, so anything changed after the
copy is still a difference for the next save.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
saveStateOnce()insrc/shared/state.jsset its baseline (what the next save compares against) from the page's state after the write. A change made while that save waited on storage went into the baseline but not into storage, so the save queued after the change found nothing to write.Fix: the save copies the page's fields when it starts, writes from that copy and keeps the same copy as the baseline, so anything changed after the copy still differs from the baseline, for every field, the merged ones included.
What
nextloses (checked with tests):networkIdchanged during the earlier save's read or write.allowedSitesstays allowed in storage, adeniedSitesornetworkEndpointschange is lost, and a deleted wallet stays stored. During the read these were already written, because the save shared the page's live objects.The
networkIdtest and the wallet-added-during-write test intests/stateMerge.test.jsfail against currentnext.next; its test only guards the fix.README.mddescribes nothing this changes; no edit.Model: opus-5-5
PASS
Model: opus-5-5