aboutsummaryrefslogtreecommitdiffstats
path: root/src/features
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-02 21:35:01 -0700
committerAdam Soltys <[email protected]>2026-10-02 21:35:01 -0700
commite42e8cca57bfc59dd8a0b8e347dcf71e2a96054a (patch)
treef53ad6dc489b130dd5fe0397fa54f422487018a8 /src/features
parent44000490cded26d830768458e2e95635ac2e129b (diff)
downloadcoinosv3-e42e8cca57bfc59dd8a0b8e347dcf71e2a96054a.tar.gz
coinosv3-e42e8cca57bfc59dd8a0b8e347dcf71e2a96054a.zip
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 <[email protected]>
Diffstat (limited to 'src/features')
-rw-r--r--src/features/messages.js3
1 files changed, 2 insertions, 1 deletions
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;