fix(signals): prevent duplicate connect requests

the ws state might not be OPEN when connect is called thus leading to
multiple connect calls being done. it should be sufficient to check that
we have the ws instance when starting to connect.

Signed-off-by: Hellgren Heikki <heikki.hellgren@op.fi>
This commit is contained in:
Hellgren Heikki
2025-02-27 09:02:46 +02:00
parent b5a82087a7
commit ac3e8c0f43
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-signals': patch
---
Fixed multiple signal connection attempts when there are multiple subscriptions at the same time
+1 -1
View File
@@ -135,7 +135,7 @@ export class SignalClient implements SignalApi {
}
private async connect() {
if (this.ws && this.ws.readyState === WebSocket.OPEN) {
if (this.ws && this.ws.readyState !== WebSocket.CLOSED) {
return;
}