PR #62

59 votes · 52 up · 7 down

View on GitHub
59
Total Votes
+52
Upvotes
-7
Downvotes
+52-7

Comments(6)

bigintersmindComment#621.337% chance to see nothing

I did some digging; I think I understand what happened, and put together a fix:

  • #173

Since page.tsx is a server component, the random check runs at build/render time, not per-visitor. When it returns null, the child components (PRList, HallOfChaos) never render, which means their fetch() calls with revalidate: 300 never execute. Without any revalidation hint, Next.js/Vercel treats the page as fully static and caches the blank result until the next deployment. So instead of 1.337% of visitors seeing nothing, one unlucky render poisoned the cache and took the site down for everyone.

#172 moves the check into IE6Layout.tsx (a client component) using useState + useEffect, so it runs per-visitor in the browser. The server always renders real content now (safe to cache), and each visitor individually rolls the 1.337% dice on hydration. Bonus: the page briefly flashes before going blank, like a crash.

lens0021Comment#621.337% chance to see nothing
graph TD
    Start([The Beginning of OpenChaos])
    Start --> PR[Merge the Most Upvoted PR]

    PR --> Check{Is this the 1.337%<br/>Blank Page PR?}

    Check -- Yes --> Collapse[OpenChaos Collapses]
    Check -- No --> Wait[Wait 24 Hours]
    Wait --> Start
openchaos-bot[bot]Comment#621.337% chance to see nothing

🤖 OpenChaos Bot

Summary: Adds a 1.337% chance that the entire homepage returns null.

Files changed: 1 (src/app/page.tsx)

Impact: Low - Affects the homepage, but is very infrequent.


openchaos-bot

ksuryaComment#621.337% chance to see nothing

lol ok

All Activity(67)

bigintersmindComment#621.337% chance to see nothing

I did some digging; I think I understand what happened, and put together a fix:

  • #173

Since page.tsx is a server component, the random check runs at build/render time, not per-visitor. When it returns null, the child components (PRList, HallOfChaos) never render, which means their fetch() calls with revalidate: 300 never execute. Without any revalidation hint, Next.js/Vercel treats the page as fully static and caches the blank result until the next deployment. So instead of 1.337% of visitors seeing nothing, one unlucky render poisoned the cache and took the site down for everyone.

#172 moves the check into IE6Layout.tsx (a client component) using useState + useEffect, so it runs per-visitor in the browser. The server always renders real content now (safe to cache), and each visitor individually rolls the 1.337% dice on hydration. Bonus: the page briefly flashes before going blank, like a crash.

lens0021Comment#621.337% chance to see nothing
graph TD
    Start([The Beginning of OpenChaos])
    Start --> PR[Merge the Most Upvoted PR]

    PR --> Check{Is this the 1.337%<br/>Blank Page PR?}

    Check -- Yes --> Collapse[OpenChaos Collapses]
    Check -- No --> Wait[Wait 24 Hours]
    Wait --> Start
openchaos-bot[bot]Comment#621.337% chance to see nothing

🤖 OpenChaos Bot

Summary: Adds a 1.337% chance that the entire homepage returns null.

Files changed: 1 (src/app/page.tsx)

Impact: Low - Affects the homepage, but is very infrequent.


openchaos-bot

ksuryaComment#621.337% chance to see nothing

lol ok