From 379d8575a7134cebb3242c8b20095b642f5f0456 Mon Sep 17 00:00:00 2001 From: William Wang Date: Sat, 7 Dec 2024 14:07:09 -0500 Subject: [PATCH] [identity] use identitySearchSocket instead of socket.current Summary: This addresses https://linear.app/comm/issue/ENG-9971/[error-invalid-state-err]-in-identitysearchprovider We should be using identitySearchSocket instead of socket.current could be null before we properly set it Test Plan: cargo check Didn't get to testing this properly. Putting up this diff for now to get it into review, but I'll ensure we're not getting spammed with: ``` ERROR [Error: INVALID_STATE_ERR] ``` before landing Reviewers: kamil, varun, ashoat Reviewed By: ashoat Subscribers: ashoat, tomek Differential Revision: https://phab.comm.dev/D14094 --- lib/identity-search/identity-search-context.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/identity-search/identity-search-context.js b/lib/identity-search/identity-search-context.js index a77d633ebf..fe93e93b6c 100644 --- a/lib/identity-search/identity-search-context.js +++ b/lib/identity-search/identity-search-context.js @@ -203,7 +203,7 @@ function IdentitySearchProvider(props: Props): React.Node { const heartbeat: Heartbeat = { type: identitySearchMessageToServerTypes.HEARTBEAT, }; - socket.current?.send(JSON.stringify(heartbeat)); + identitySearchSocket.send(JSON.stringify(heartbeat)); } };