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 <[email protected]>
This commit is contained in:
Raven Scott
2026-05-22 01:37:57 -04:00
co-authored by Cursor
parent 45c1b29d92
commit e5c9b10d7d
+2 -2
View File
@@ -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 {