The seat wallet's cap of fifty drops the oldest seats, not the newest

Seats are kept newest first, but the cap kept the tail, so a browser
holding more than fifty threw away the seat it had just taken. Sitting
in that room hid it (each room message remembers the seat again); the
first games poll after moving to another table lost it for good.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Eric WagonerandClaude Opus 5.5 committed 2026-10-30 18:13:09 -04:00
1 parent 29025f2ccb
commit bca4d5eba7
1 file changed
+2 -1
+2 -1
View File
@@ -754,7 +754,8 @@ class Net {
for (const key of voided) { if (this.voidedOnce.has(key)) doubted.add(key); }
this.voidedOnce = voided;
let kept = this.seats.filter((s) => !doubted.has(`${s.roomId}:${s.name}`));
if (kept.length > 50) kept = kept.slice(kept.length - 50);
// Newest first (rememberSeat puts a seat at the front): the oldest go.
if (kept.length > 50) kept = kept.slice(0, 50);
if (kept.length !== this.seats.length) {
this.seats = kept;
saveSeats(this.seats);