fix(marketing): don't let a refused profile read get cached
Follow-up to #7281, which I merged before clearing this finding.
Problem
loadProfile turns a refused leaderboard read into a rate-limited state and the page renders ProfileUnavailable for it. That render is an ordinary 200 on a route with export const revalidate = 300, so a single refusal could be cached and served to every visitor of that handle and locale for the rest of the window. On a public, crawled profile URL that is the wrong thing to hold onto.
The window is narrow in practice: with LEADERBOARD_INTERNAL_TOKEN set (it now is, in both environments) marketing's server reads are exempt from the anonymous limiter and this state is not reached. It becomes reachable again the moment the token is absent or rotated wrong, which is exactly when you least want the retry page pinned in front of real profiles.
Fix
unstable_noStore() in the branch that produces the state, rather than at the call sites. Both consumers of loadProfile (the page and generateMetadata) are covered by the one call, and a third consumer cannot be added without it. Successful profiles and notFound() are untouched and still cache normally.
opengraph-image.tsx and the fight page call fetchParticipant directly and still throw on a refusal, so ISR keeps their stale output. Unchanged here.
Verification
$ bunx biome check apps/marketing/src/app/[lang]/user/[handle]/utils/loadProfile/loadProfile.ts
Checked 1 file in 35ms. No fixes applied.
$ cd apps/marketing && bun run typecheck
$ tsc --noEmit
(clean)
$ cd apps/marketing && bun test "src/app/[lang]/utils" "src/app/[lang]/user"
11 pass
0 fail
Ran 11 tests across 1 file. [47.00ms]
Refs MARKETING-6C
https://claude.ai/code/session_01Lympqm6njii4G2VqdfA4sg
Summary by cubic
Prevents a refused leaderboard read from caching the "profile unavailable" page and serving it to every visitor of that handle for the 300s revalidate window. loadProfile now calls unstable_noStore() when it produces the rate-limited state, covering both the page and generateMetadata; successful profiles and notFound() still cache normally.