From 229746922fbd566ef9014845c2111c5044ac91fa Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 22 Sep 2026 11:24:34 -0700 Subject: Ark: receives waiting with another server are claimed; notifications belong to the identity. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Once per session the wallet visits every other Ark server it holds state with — its own manager, a receive rescan, a sync to claim — and says what arrived and where; the coins wait there until a switch back. The stored notification list remembers which identity fetched it, so another identity on the same wallet starts empty instead of reading the previous one's. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01Tmfg8k5f3TbNJS34qiqHAp --- src/features/messages.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/features/messages.js') diff --git a/src/features/messages.js b/src/features/messages.js index b97ff8d..e5bc300 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -7063,9 +7063,14 @@ export function messagesFeature(ctx) { let notif = null; // { status, items } let notifAt = 0, notifUnsub = null; const notifSeen = () => st().notifSeen || 0; + // Notifications are about the IDENTITY, not the wallet: the stored list + // remembers whose it is, and another identity on the same wallet starts + // empty instead of reading the previous one's. + const identityPk = () => (hook('nostrLoginIdentity') || {}).pubkey || (wallet.nostr && wallet.nostr.pk) || null; function notifNow() { if (!notif) { - const stored = st().notifs || []; + const s = st(); + const stored = (!s.notifsPk || s.notifsPk === identityPk()) ? (s.notifs || []) : []; notif = { status: stored.length ? 'ready' : 'loading', items: stored }; refreshNotifs(); } @@ -7116,7 +7121,7 @@ export function messagesFeature(ctx) { c.items = kept.slice(0, NOTIF_KEEP); // the rows already say who; a reply row also wants its reader-facing text, // which it carries — the events themselves are not kept - const s2 = st(); s2.notifs = c.items; save(s2); + const s2 = st(); s2.notifs = c.items; s2.notifsPk = identityPk(); save(s2); // a reply is a note we can open straight away; keep it in hand for (const ev of evs) if (ev.kind === 1) notifNotes.set(ev.id, ev); return true; -- cgit v1.2.3