Skip to content

fix(FE-101): gate watch page mock data behind dev flag, stub missing endpoints - #1534

Merged
chinweobtagaz merged 1 commit into
OpenKnight-Foundation:mainfrom
Fran6ix-coder:fix/fe-101-watch-page-endpoints
Oct 24, 2026
Merged

chinweobtagaz merged 1 commit into
OpenKnight-Foundation:mainfrom
Fran6ix-coder:fix/fe-101-watch-page-endpoints

Conversation

@Fran6ix-coder

Copy link
Copy Markdown
Contributor

What

Closes #1342 (FE-101).

GET /v1/games/live and the spectate WS route don't exist on the backend yet. The watch page was calling them unconditionally, causing a runtime error on every load. Mock data was also always imported regardless of environment.

Changes

** rontend/lib/api.ts**

  • Commented out games.live() and games.spectate() with TODO(FE-101) markers so there is no callable path to the missing routes.

** rontend/app/watch/page.tsx**

  • Added useMockLiveGames flag (NODE_ENV === 'development' && NEXT_PUBLIC_USE_MOCK_LIVE_GAMES === 'true') — same pattern as the puzzles page.
  • Mock data seeds initial state only when the flag is on.
  • Replaced the live fetch useEffect with a stub that sets a clear error message until the backend route ships.
  • Removed the now-dead
    ormalizeLiveGame helper and the unused endpoints import.

** rontend/.env.example**

  • Added NEXT_PUBLIC_USE_MOCK_LIVE_GAMES=false next to the existing NEXT_PUBLIC_USE_MOCK_PUZZLES flag.

Testing

  • With NEXT_PUBLIC_USE_MOCK_LIVE_GAMES=true in .env.local: watch page renders mock games as before.
  • Without the flag (default): watch page shows the \ etchError\ banner — no network call to a missing route.
  • rontend-check CI (lint + build + e2e) is the only workflow that fires on rontend/** changes; no other workflow is affected.

@drips-wave

drips-wave Bot commented Oct 21, 2026

Copy link
Copy Markdown

@Fran6ix-coder Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@chinweobtagaz
chinweobtagaz merged commit e823907 into OpenKnight-Foundation:main Oct 24, 2026
@chinweobtagaz

Copy link
Copy Markdown
Contributor

Merged, thanks @Fran6ix-coder. Two follow-ups were needed on main:

Next time: when you remove or stub out an export, search for its callers first, and run npx tsc --noEmit and npm run lint before pushing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FE-101: Watch Page Depends on /v1/games/live and /v1/games/{id}/spectate, Which Don't Exist

2 participants