Skip to content

Commit 0edcf63

Browse files
committed
grpc_connection.ts: synthesize the 'onConnected' event that WebChannelConnection sends
1 parent e962a73 commit 0edcf63

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/firestore/src/platform/node/grpc_connection.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,15 @@ export class GrpcConnection implements Connection {
286286
}
287287
});
288288

289+
let onConnectedSent = false;
289290
grpcStream.on('data', (msg: Resp) => {
290291
if (!closed) {
291292
logDebug(LOG_TAG, `RPC '${rpcName}' stream ${streamId} received:`, msg);
293+
// Emulate the "onConnected" event that WebChannelConnection sends.
294+
if (!onConnectedSent) {
295+
stream.callOnConnected();
296+
onConnectedSent = true;
297+
}
292298
stream.callOnMessage(msg);
293299
}
294300
});

0 commit comments

Comments
 (0)