feat: Update RoomInstance handling to serialize roomInstanceId as string for JSON compatibility; add tests to ensure correct behavior

This commit is contained in:
Alexa
2026-07-08 03:04:45 +03:00
parent 9c1a4a0a56
commit 802e7c456a
3 changed files with 187 additions and 12 deletions
+8 -3
View File
@@ -113,7 +113,10 @@ export interface RoomRoleGrant {
// else lowest-pid). The matching participant has isMaster=true so the
// UI can tag a row without recomputing.
export interface RoomInstance {
roomInstanceId: number;
// String, not number: instance ids are int64s past JS's 2^53 safe
// range, so the server sends them as strings to survive JSON.parse.
// Used verbatim in pull/close URLs — never coerce to Number.
roomInstanceId: string;
roomId: number;
subRoomId: number;
roomName: string;
@@ -229,7 +232,7 @@ export interface Stats {
roomId: number;
name: string;
subRoomId: number;
roomInstanceId: number;
roomInstanceId: string;
photonRoomId: string;
photonRegionId: string;
isPrivate: boolean;
@@ -287,7 +290,9 @@ export interface StorefrontDefinition {
}
export interface Instance {
roomInstanceId: number;
// String, not number — int64 past JS's 2^53 safe range (server sends
// it as a string so JSON.parse doesn't round it).
roomInstanceId: string;
roomId: number;
subRoomId: number;
roomName: string;