Skip to content

Commit 4211ffc

Browse files
bhfCopilot
andcommitted
Delay websocket cache update to ensure connection stability
Co-authored-by: Copilot <copilot@github.com>
1 parent a6d211d commit 4211ffc

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

libraries/typescript/src/integration.test.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,13 @@ if (shouldRun && !wsUrl) {
7979
if (status === 'Connected' && !openedTriggered) {
8080
openedTriggered = true;
8181
// Trigger cache update which should reflect in websocket
82-
embedded.put('ws-key', 'ws-val').catch(err => {
83-
clearTimeout(timeout);
84-
ws.close();
85-
reject(err);
86-
});
82+
setTimeout(() => {
83+
embedded.put('ws-key', 'ws-val').catch(err => {
84+
clearTimeout(timeout);
85+
ws.close();
86+
reject(err);
87+
});
88+
}, 1000);
8789
}
8890
};
8991

0 commit comments

Comments
 (0)