fix: hydrate WhatsApp participating groups on connect (#58007) (thanks @neeravmakwana)

* Web: hydrate participating groups on connect

* Web: avoid blocking inbox listeners during group hydration
This commit is contained in:
Neerav Makwana
2026-03-31 00:39:18 -04:00
committed by GitHub
parent 235908c30e
commit 763d5cea44
5 changed files with 68 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ export type MockBaileysSocket = {
sendPresenceUpdate: ReturnType<typeof vi.fn>;
sendMessage: ReturnType<typeof vi.fn>;
readMessages: ReturnType<typeof vi.fn>;
groupFetchAllParticipating: ReturnType<typeof vi.fn>;
user?: { id?: string };
};
@@ -138,6 +139,7 @@ export function createMockBaileys(): {
sendPresenceUpdate: vi.fn().mockResolvedValue(undefined),
sendMessage: vi.fn().mockResolvedValue({ key: { id: "msg123" } }),
readMessages: vi.fn().mockResolvedValue(undefined),
groupFetchAllParticipating: vi.fn().mockResolvedValue({}),
user: { id: "123@s.whatsapp.net" },
};
setImmediate(() => ev.emit("connection.update", { connection: "open" }));