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:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-signals': patch
|
||||
---
|
||||
|
||||
Fixed multiple signal connection attempts when there are multiple subscriptions at the same time
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user