aboutsummaryrefslogtreecommitdiffstats
path: root/tools/nwc-sw-test.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-09-14 09:06:02 -0700
committerAdam Soltys <[email protected]>2026-09-14 09:06:02 -0700
commit671d2a96474f59ca9234c876ce6604d03de95727 (patch)
treed732896288985033c0531b70b7bcad0cc388cb00 /tools/nwc-sw-test.js
parent6394de43d4e596aaeddd2b262bb7a595679d8fbc (diff)
downloadcoinosv3-671d2a96474f59ca9234c876ce6604d03de95727.tar.gz
coinosv3-671d2a96474f59ca9234c876ce6604d03de95727.zip
One device pays a zap, whichever of them heard it first.
Every awake device of a wallet hears a wallet-connect pay request within the same second, and the per-tab lock only reaches one browser profile: two profiles on one laptop each locked an HTLC for the same 21-sat zap. The push notifier now hands each pay request to the first device that claims it; a device that loses the claim stands down silently, and a device that cannot reach the notifier answers as before so nobody goes quiet over a hiccup. The worker path claims the same way. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01QYJfZ4A1TDCEY4Foq3CApR
Diffstat (limited to 'tools/nwc-sw-test.js')
-rw-r--r--tools/nwc-sw-test.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/nwc-sw-test.js b/tools/nwc-sw-test.js
index acf3027..ae79e18 100644
--- a/tools/nwc-sw-test.js
+++ b/tools/nwc-sw-test.js
@@ -51,6 +51,9 @@ function harness({ rec = baseRec(), recs = null, answered = false } = {}) {
published.push(JSON.parse(opts.body).event);
return { ok: true, json: async () => ({ ok: true }) };
}
+ if (url.includes('/claim')) {
+ return { ok: true, json: async () => ({ ok: true }) };
+ }
if (url.includes('/answered')) {
return { ok: true, json: async () => ({ answered: typeof answered === 'function' ? answered() : answered }) };
}