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
This commit is contained in:
cottongin
2026-03-20 11:34:15 -04:00
parent 2503c3fc09
commit 03f79422af

View File

@@ -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;