From ec1d6b8c6da0f9e4e169f4e8f95b88133207b741 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 5 Sep 2026 21:38:09 -0700 Subject: Payment push notifications are scoped to their network, so a mainnet payment stops opening the staging PWA. The same seed derives the same nostr pubkey on mainnet and staging, so both PWAs registered push under one pubkey and the notifier — matching only by pubkey — fanned every mainnet payment out to the staging subscription too; tapping it opened staging.coinos.io. Now the client stamps its network on the push registration (pushWatch net: getNetwork()), the registrar declares its own network on the /notify call (CFG.forwarder.network), and nwcpush delivers a payment only to registrations whose net matches — with a rollout-safe fallback: a device that hasn't re-registered yet (net=null) still gets the push, and a caller that omits net still reaches everyone, so nobody goes dark mid-deploy. Deployed names + nwcpush on cs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01MGzU12QrAA4G6BYGzGVdXz --- src/features/messages.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/features/messages.js b/src/features/messages.js index a370097..582bf3b 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -999,7 +999,12 @@ export function messagesFeature(ctx) { // never sends what the user turned off (a suppressed-but-delivered push // would earn Chrome's generic "updated in background" nag instead) const reasons = { payment: s.reasons?.payment !== false, dm: s.reasons?.dm !== false }; - return { ptags: myPubkeys(), authors, reasons }; + // Stamp the network: the same seed makes the same nostr pubkey on mainnet + // AND staging, so without this the notifier fans a mainnet payment push + // out to the staging PWA's subscription too — and tapping it opened + // staging. The notifier now delivers a payment only to registrations on + // the payment's own network. + return { ptags: myPubkeys(), authors, reasons, net: getNetwork() }; } const roomNotify = (cid) => !!st().notify[cid]; -- cgit v1.2.3