Add reversible administrator room archiving
Organize closed rooms with archive filters, live-authorized atomic receipts and exact saved retries. Preserve saved games, timestamps, credentials, discussion and AI deadlines. Unarchive leaves play closed; reopen requires unarchive, and removal/restoration preserves both flags. Verified types, lint, 5379 offline tests, 52 HTTP tests and build. Twenty dedicated administrator HTTP groups and independent privacy/persistence review passed. Desktop/mobile browser QA confirmed a single archive after a lost response and refresh, readable recovery text, mobile unarchive and separate reopening, and saved-seat restoration. All 2,049 baseline rooms, 4,348 seats and related records preserved. Authenticated production admin acceptance awaits authorized QA access; full admin and rules gates remain open.
This commit is contained in:
1 parent
98b1b3261b
commit
e918e2e0c0
35 files changed
+3624
-38
No files matched your search
@@ -9,7 +9,7 @@ const integer = (value: unknown): value is number => Number.isSafeInteger(value)
|
||||
const timestamp = (value: unknown) => value === null || integer(value) && value <= 8_640_000_000_000_000;
|
||||
|
||||
export function validAdminClosureView(value: unknown): value is AdminClosureView {
|
||||
return object(value) && keys(value, ['removed', 'code', 'version', 'closed', 'revision', 'closedAt', 'updatedAt', 'paused', 'joinLocked']) &&
|
||||
return object(value) && keys(value, ['removed', 'code', 'version', 'closed', 'revision', 'closedAt', 'updatedAt', 'paused', 'joinLocked', ...(value.archived === true ? ['archived'] : [])]) &&
|
||||
typeof value.code === 'string' && /^[A-Z2-9]{8}$/.test(value.code) && integer(value.version) && integer(value.revision) &&
|
||||
typeof value.removed === 'boolean' && typeof value.closed === 'boolean' && typeof value.paused === 'boolean' && typeof value.joinLocked === 'boolean' &&
|
||||
timestamp(value.closedAt) && timestamp(value.updatedAt);
|
||||
@@ -36,6 +36,7 @@ export function newAdminClosureRequest(view: AdminClosureView, closed: boolean,
|
||||
const input = { operationId: randomId(), expectedVersion: view.version, expectedRevision: view.revision, closed, reason: reason.trim() };
|
||||
if (!validAdminClosureInput(input)) throw new Error('Enter a reason of 1–300 characters on one line.');
|
||||
if (view.removed) throw new Error('Restore this removed room before changing its closure.');
|
||||
if (view.archived) throw new Error('Unarchive this room before reopening it.');
|
||||
if (closed === view.closed) throw new Error('Refresh the room before choosing a closure or reopening.');
|
||||
return input;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user