From e72419dfe5df0a1bf18167a9abe04b7a6a5f0f32 Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Wed, 16 Sep 2026 14:33:28 -0500 Subject: [PATCH] test: update connection id mock --- src/mock-builders/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mock-builders/index.ts b/src/mock-builders/index.ts index 0e1810d7f..f53811982 100644 --- a/src/mock-builders/index.ts +++ b/src/mock-builders/index.ts @@ -8,7 +8,10 @@ const token = 'dummy_token'; const connectUser = (client: StreamChat, user: Partial) => new Promise((resolve) => { - client['connectionId'] = 'dumm_connection_id'; + // v10 keeps the connection id on `client.connectionIdManager`; requests that register a + // watch/presence subscription await it, so a mocked connect has to publish one or every + // `queryChannels()`/`channel.watch()` in the tests throws. + client.connectionIdManager.resolveConnectionId('dumm_connection_id'); client.user = { ...user, mutes: [] } as UserResponse; client['_user'] = { ...user } as UserResponse; // `userID` is a getter in v10 (derives from `client.user?.id`), so it can't be assigned;