From e5c9b10d7de82975ed185556c3379c3fdb311be1 Mon Sep 17 00:00:00 2001 From: Raven Scott Date: Fri, 22 May 2026 01:37:57 -0400 Subject: [PATCH] fix(contacts): use mux-wire wireReady before gossip broadcast Prevents contacts presence and friend-request gossip from blocking on protomux fullyOpened() that never resolves on stale connections. Co-authored-by: Cursor --- mesh.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mesh.js b/mesh.js index e6c6ee0..770aee5 100644 --- a/mesh.js +++ b/mesh.js @@ -3,7 +3,7 @@ const Protomux = require('protomux') const b4a = require('b4a') const { encodeRpc, decodeRpc } = require('pearcord-shared') -const { openWireChannel } = require('pearcord-drive/mux-wire') +const { openWireChannel, wireReady } = require('pearcord-drive/mux-wire') const CONTACTS_PROTOCOL = 'pearcord-contacts-v1' @@ -30,7 +30,7 @@ async function broadcastContactsGossip (contacts, method, payload) { await Promise.all( sessions.map(async (session) => { try { - const ok = await session.fullyOpened().catch(() => false) + const ok = await wireReady(session, 6000) if (!ok) return session.send(buf) } catch {