🐡🐋 ↝ [uzm1um ++]: New layout, new font, new research system#224
Merged
Gizmotronn merged 17 commits intomainfrom Apr 27, 2026
Merged
🐡🐋 ↝ [uzm1um ++]: New layout, new font, new research system#224Gizmotronn merged 17 commits intomainfrom
Gizmotronn merged 17 commits intomainfrom
Conversation
- game/page.tsx: use getUser() (server-validated) instead of getSession() (cached/stale), call getGamePageDataForUser() directly to eliminate double-auth that caused 408 timeout for new OAuth users on Vercel - layout.tsx: self-host Syne Mono woff2 to remove Google Fonts build-time network dependency - Fix TypeScript errors across NextScene, aavso, FinishProfile, ProfileSetup, test files, tsconfig vitest globals conflict - Onboarding: localStorage step persistence (ob5), satellite tutorial wiring (ob6), mobile InteractiveTutorial overlay fix Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The game page was running 13+ Prisma queries server-side on every cold start, consistently hitting Vercel's 10s function timeout. Auth was correct but the data load was the actual kill shot. Now: server component only auth-gates (getUser, fast), passes null initialData. GameClient detects null and immediately fetches via the existing /api/gameplay/page-data route, showing a skeleton meanwhile. Subsequent refreshes work the same as before. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Server Components cannot write cookies. When getUser() refreshes an expired OAuth token it calls setAll() which Next.js blocks in SC context, throwing and producing the 408. Fix: middleware now owns the Supabase client + getUser() call so token refresh cookie writes happen on the response (middleware CAN do this). game/page.tsx uses getSession() — reads the already-refreshed cookie, no network call, no writes, cannot throw. Ref: https://supabase.com/docs/guides/auth/server-side/nextjs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two bugs causing the 408: 1. Middleware was returning a plain NextResponse.redirect() when sending users to /game. Any cookies refreshed by getUser() lived on supabaseResponse but were thrown away. Browser made the next request with stale tokens. Server component tried to refresh them, setAll() threw (Server Components cannot write cookies), 408. Fix: redirectWithCookies() copies supabaseResponse cookies onto every redirect response so the browser always gets the updated tokens. 2. createBrowserClient (@supabase/ssr) uses PKCE by default. Without /auth/callback to exchange the OAuth code, new Google logins never produced a server-readable session. Fix: added src/app/auth/callback/route.ts with exchangeCodeForSession. Also: update Supabase redirect URL in dashboard to <site>/auth/callback for PKCE to complete. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- layout.tsx: revert to next/font/google (Vercel builds have DNS; local DNS broken so local builds failed with localFont anyway) - page-data route: add stack trace logging so Vercel function logs show the exact query/line causing the 500 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Gizmotronn
commented
Apr 27, 2026
Member
Author
Gizmotronn
left a comment
There was a problem hiding this comment.
All tests passed, as of the last commit AFAIk
Contributor
| \n## Coverage Report\n\n- Code Coverage: **28.3%**\n- SDD Coverage: **0.0%** (0/6 linked tasks)\n\n_Generated by `coverage-badges` workflow._ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.