From fec3fc5258ffe126ba553021c873b404950f1fc3 Mon Sep 17 00:00:00 2001 From: Devin Zuczek Date: Wed, 30 Sep 2026 10:52:43 -0400 Subject: [PATCH] [api] update progression stub --- apps/api/src/routes/progression.ts | 17 ++++++++--------- apps/api/src/test/integration/api.test.ts | 8 ++++---- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/apps/api/src/routes/progression.ts b/apps/api/src/routes/progression.ts index 9f665dd..909abac 100644 --- a/apps/api/src/routes/progression.ts +++ b/apps/api/src/routes/progression.ts @@ -524,23 +524,22 @@ export const progressionRoutes = new Hono({ strict: false }) // The progression event running right now — the limited-time XP event the client shows // a banner and a progress track for. // - // STUB: a bare `-1`, the reference server's "no active event" value (the id of the - // active event, or -1 when there is none). The client reads it as "no event on" and - // skips the event UI entirely. That is the honest answer (nothing here runs events) and - // the safe one: a fabricated event would draw a track that never fills. No auth — - // whether an event is running is the same fact for everybody, and the client asks while - // loading. + // STUB: a bare `0` — the id of the active event, or 0 when there is none (this once + // served -1 for the same meaning). The client reads it as "no event on" and skips the + // event UI entirely. That is the honest answer (nothing here runs events) and the safe + // one: a fabricated event would draw a track that never fills. No auth — whether an + // event is running is the same fact for everybody, and the client asks while loading. .get( '/api/progressionEvents/active', describeRoute({ tags: ['Progression'], summary: 'Progression event currently running (stub)', description: - 'The limited-time XP event in progress, as a bare event id. Always `-1` — the ' + + 'The limited-time XP event in progress, as a bare event id. Always `0` — the ' + '“no active event” value; nothing on this server runs one — which the client reads ' + 'as “no event” and skips the event UI, where a 404 would stall the load. No auth: ' + 'it is the same answer for every player.', - responses: { 200: json(BareInteger, 'A bare `-1` — no event is running') }, + responses: { 200: json(BareInteger, 'A bare `0` — no event is running') }, }), - (c) => c.json(-1) + (c) => c.json(0) ) diff --git a/apps/api/src/test/integration/api.test.ts b/apps/api/src/test/integration/api.test.ts index e6c8785..1f6194b 100644 --- a/apps/api/src/test/integration/api.test.ts +++ b/apps/api/src/test/integration/api.test.ts @@ -2066,12 +2066,12 @@ describe('public endpoints', () => { expect(res.status).toBe(400) }) - test('GET /api/progressionEvents/active is a bare -1 (no auth)', async () => { - // -1 is the reference server's "no active event" value; the client reads it as "no event - // running" and skips the event UI. A 404 would stall its load instead. + test('GET /api/progressionEvents/active is a bare 0 (no auth)', async () => { + // 0 is the "no active event" value; the client reads it as "no event running" and + // skips the event UI. A 404 would stall its load instead. const res = await exports.default.fetch(`${ORIGIN}/api/progressionEvents/active`) expect(res.status).toBe(200) - expect(await res.json()).toBe(-1) + expect(await res.json()).toBe(0) }) test('GET /api/rooms/v1/filters returns an object with filter arrays', async () => {