diff options
| author | Adam Soltys <[email protected]> | 2026-09-09 23:12:13 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-09-09 23:12:13 -0700 |
| commit | 57289fd3f87554e9981ddc2c63c3bba805d599bd (patch) | |
| tree | 9a307f9d5382c8f727e9ae12a56709fc41a226a4 /src/sync-outbox.js | |
| parent | 839ab937afbd0c68d1a4366e10145274b6f62d31 (diff) | |
| download | coinosv3-57289fd3f87554e9981ddc2c63c3bba805d599bd.tar.gz coinosv3-57289fd3f87554e9981ddc2c63c3bba805d599bd.zip | |
Phone boot: remember opened DM wraps across boots; supersede stuck relay-only sync records.
A remote-signer (bunker) wallet re-opened the relay's last ~400 gift wraps
on EVERY boot — the seen-set lived in memory only — and each wrap costs two
NIP-46 round trips with a schnorr sign+verify apiece on the client. On the
Pixel that was ~4s of a 15s pegged boot. Opened (and given-up) wrap ids are
now kept in the messages feature state, bounded to 1500 id prefixes, and
loaded before the inbox subscription.
The outbox also replaces a record whose route changed even when its digest
matches: the 874KB relay-only ark record that could never publish would
otherwise have stayed in front of its Blossom successor forever.
Verified live: the wallet's 633KB ark domain uploaded to blossom.coinos.io
and its pointer was acknowledged by relay.coinos.io on the next boot.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Nw1Dijik1tLVKRM1WkU7xE
Diffstat (limited to 'src/sync-outbox.js')
| -rw-r--r-- | src/sync-outbox.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/sync-outbox.js b/src/sync-outbox.js index 2062d9e..80042d1 100644 --- a/src/sync-outbox.js +++ b/src/sync-outbox.js @@ -52,7 +52,10 @@ export class SyncOutbox { const key = PREFIX + pubkey + ':' + dtag; let previous; try { previous = JSON.parse(this.storage.getItem(key)); } catch {} - if (previous?.digest === digest) { this.wake(); return; } + // Same content, same route: nothing to do. A record that changed route + // (an oversized domain now bound for Blossom, or back inline) is replaced + // even for identical content — the stuck relay-only copy must go. + if (previous?.digest === digest && !!previous.blob === !!blob) { this.wake(); return; } // A pending, never-sent event can be replaced within the same second. // Once attempted, use a later timestamp: Nostr resolves equal timestamps // by event id, which can otherwise leave the OLD snapshot in the relay. |
