fix: sub-room id sequence, restore sync, presence index TTL, permission races

From the local CodeRabbit review:
- Scene ids: the repair and room clone assigned max + 1, which never
  advanced the Postgres identity sequence (live: sequence 3412, max id 3466),
  so the next add / clone sub-room would collide on the primary key. The
  repair now moves the sequence past the highest id at startup, and both
  let the database assign ids.
- Room-level restores (datahistory/restore and the admin restore) now also
  restore the entry sub-room, whose blob room details serve first.
- TouchRoom refreshes the room's presence index too, so players kept alive
  only by heartbeats no longer drop out of the instance browser after 20 min.
- Sub-room permission saves match cells exactly (as the unique index does)
  and retry when a concurrent editor inserted the same new cell.
This commit is contained in:
Alexa
2026-10-25 13:59:30 +02:00
parent 9076fb9fae
commit 8be0f90dbc
5 changed files with 129 additions and 43 deletions
@@ -60,7 +60,7 @@ public static class RoomPermissionMatrix
var cell = new Cell(row.Permission, row.Role, row.Override, row.Type, row.Value);
var at = cells.FindIndex(c =>
c.Role == row.Role
&& string.Equals(c.Permission, row.Permission, StringComparison.OrdinalIgnoreCase));
&& string.Equals(c.Permission, row.Permission, StringComparison.Ordinal));
if (at >= 0) cells[at] = cell;
else cells.Add(cell);
}