misc cleanup

This commit is contained in:
Devin Zuczek
2026-07-21 01:20:20 -04:00
parent 41fa8b9979
commit 086441f6f5
7 changed files with 12 additions and 11 deletions
+1 -1
View File
@@ -121,7 +121,7 @@ function toSelfAccountDto(account: Account) {
const HUB_INSTANCE = 'global'
/**
* Push the notifications that follow an account mutation, mirroring the C#/Go
* Push the notifications that follow an account mutation, mirroring the reference
* hub behavior: the owner receives `SelfAccountUpdate` and `AccountUpdate`, and
* every connected client receives an `AccountUpdate` broadcast. Hub failures are
* logged and swallowed — the account write has already committed, so a hub
+1 -1
View File
@@ -1,6 +1,6 @@
/**
* Default player settings seeded on a player's first read, ported verbatim from
* the C# `PlayerSettingsController.GetPlayerSettings`. Ordered; written to KV the
* the reference's `PlayerSettingsController.GetPlayerSettings`. Ordered; written to KV the
* first time a player has no stored settings.
*/
export const DEFAULT_SETTINGS: Array<{ Key: string; Value: string }> = [
+1 -1
View File
@@ -1,5 +1,5 @@
-- Room instances — live sessions of a room. Stored as a JSON blob in `data` with
-- generated (virtual) columns for every field (snake_case, per the C# `[Column]`
-- generated (virtual) columns for every field (snake_case, per the reference's `[Column]`
-- names), the same pattern as the rooms/accounts tables. `id` (roomInstanceId) is
-- a sequential key held in the blob. Generated from src/room-instance-db.ts
-- (SCHEMA_DDL) — keep in sync. Written/read by the match worker.
+1 -1
View File
@@ -1058,7 +1058,7 @@ describe('rooms endpoints', () => {
expect(created.roomInstanceId).toBeGreaterThan(0)
expect(created.roomId).toBe(2)
expect(created.isPrivate).toBe(true)
expect(created.EncryptVoiceChat).toBe(true) // PascalCase JSON key, per the C#
expect(created.EncryptVoiceChat).toBe(true) // PascalCase JSON key, per the reference
// Reads back identically; JsonIgnore columns are not in the DTO.
const fetched = await getRoomInstance(env.DB, created.roomInstanceId)
+2 -4
View File
@@ -4,6 +4,7 @@ import { useWorkersLogger } from 'workers-tagged-logger'
import { withOnError } from '@repo/hono-helpers'
import { NotificationType } from '../../notify/src/notification-types'
import { docsPage, fetchSpec } from './docs'
import { accountsBase, apiBase, authBase, imgBase, notifyBase, postForm } from './upstream'
@@ -37,9 +38,6 @@ const WEB_PLATFORM = '4'
*/
const ADMIN_ROLES = new Set(['developer', 'moderator'])
/** `NotificationType.ServerMaintenance` in the notify worker's enum. */
const SERVER_MAINTENANCE = 25
/** Cookie flags for the session token. `secure` is dropped for local http dev. */
function sessionCookieOptions(c: Context<App>, maxAge: number): CookieOptions {
const local = c.env.ENVIRONMENT === 'development' || c.env.ENVIRONMENT === 'VITEST'
@@ -247,7 +245,7 @@ const app = new Hono<App>()
method: 'POST',
headers: { 'content-type': 'application/json', authorization: `Bearer ${token}` },
body: JSON.stringify({
notificationType: SERVER_MAINTENANCE,
notificationType: NotificationType.ServerMaintenance,
data: { StartsInMinutes: startsIn },
}),
})