From e42e8cca57bfc59dd8a0b8e347dcf71e2a96054a Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 2 Oct 2026 21:35:01 -0700 Subject: Group chats notice a relay that dropped their subscription A group that misses a commit is stuck until it hears it, and a group founded by White Noise can live on a single relay. Its subscriptions now report a close to the chat watchdog, and one made while a relay was being skipped as dead is rebuilt when that relay comes back. Co-Authored-By: Claude Fable 5.1 --- src/features/messages.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/features') diff --git a/src/features/messages.js b/src/features/messages.js index 917202e..812a124 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -1237,6 +1237,7 @@ export function messagesFeature(ctx) { if (dmStarted) for (const u of liveRelayList(DM_RELAYS)) urls.add(u); for (const room of rooms.values()) if (room.subscribed) for (const u of liveRelayList(room.relays)) urls.add(u); if (wn) for (const u of liveRelayList(wn.relaysInUse())) urls.add(u); + if (wn && wn.starved()) subsDead = true; // a group's relay came back after being skipped const dead = [...urls].filter((u) => !relayAlive(u)); if (!dead.length && !subsDead) { rebuildBackoff = 15_000; return; } const now = Date.now(); @@ -2978,7 +2979,7 @@ export function messagesFeature(ctx) { let relays = null; try { relays = JSON.parse(localStorage.getItem('coinos-group-relays') || 'null'); } catch {} const c = m.marmotClient({ - scope: wallet._cacheKey() + ':' + pk, pubkey: pk, identity, on: onWn, + scope: wallet._cacheKey() + ':' + pk, pubkey: pk, identity, on: onWn, subClosed: noteSubClosed, ...(Array.isArray(relays) && relays.length ? { relays } : {}), }); wn = c; -- cgit v1.2.3