From 03f79422afe0203c9a8ef2b856a361181c2ba2ca Mon Sep 17 00:00:00 2001 From: cottongin Date: Fri, 20 Mar 2026 11:34:15 -0400 Subject: [PATCH] fix: clean up activeShards on reconnection failure Remove stale entries from the activeShards map when reconnectWithBackoff exhausts all attempts or detects room closure. Made-with: Cursor --- backend/utils/ecast-shard-client.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/utils/ecast-shard-client.js b/backend/utils/ecast-shard-client.js index 9f8ab60..908e518 100644 --- a/backend/utils/ecast-shard-client.js +++ b/backend/utils/ecast-shard-client.js @@ -378,6 +378,7 @@ class EcastShardClient { reason: 'room_closed', finalPlayerCount: this.playerCount, }); + activeShards.delete(`${this.sessionId}-${this.gameId}`); return false; } @@ -397,6 +398,7 @@ class EcastShardClient { reason: 'connection_failed', finalPlayerCount: this.playerCount, }); + activeShards.delete(`${this.sessionId}-${this.gameId}`); return false; } finally { this.reconnecting = false;