Skip to content

fix(auth): the hydration ceiling did not reach isAuthenticated - #813

Merged
github-actions[bot] merged 1 commit into
mainfrom
fix/auth-ceiling
Aug 28, 2026
Merged

fix(auth): the hydration ceiling did not reach isAuthenticated#813
github-actions[bot] merged 1 commit into
mainfrom
fix/auth-ceiling

Conversation

@catomean

Copy link
Copy Markdown
Collaborator

The timeline was not slow. It was waiting on a gate that could no longer open.

useRequireAuth exposes isLoading and hydrated as effective values: a 4s ceiling resolves them so a page stops waiting on an auth store that is never going to answer. isAuthenticated was computed from the raw store, so it opted itself out of the ceiling every other field honours.

/timeline renders isLoading ? spinner : !isAuthenticated ? spinner : content. The ceiling cleared the first gate after 4s; the second stayed shut forever. It never redirected either — the redirect only fires when there is no user, and there was one, which is why the header kept rendering notifications the whole time.

Measured live, on a fully signed-in session

domInteractive 903ms
all support API calls done by 2.1s
feed request never made
long tasks none
articles after 122s 0

Zero network and zero long tasks is what separates this from a performance problem. Nothing was slow — nothing was running. The same page rendered in ~10s on other loads, which is exactly what made it look like variable slowness rather than a stuck gate, and why my earlier timings ranged from 10s to 48s.

Safety

!!user is unchanged and still does the real work: a timed-out ceiling can only report authenticated for someone who already has a user object. The "no user" case is asserted, so the ceiling can never invent a session.

The hook had no tests at all, despite gating every authenticated page. Proven by mutation: restoring the raw flags fails the "lets a signed-in user through" case and only that one.

🤖 Generated with Claude Code

https://claude.ai/code/session_012dpTLxh5GJWeWTF1UEvcD5

The timeline was not slow. It was waiting on a gate that could no longer
open.

useRequireAuth exposes isLoading and hydrated as EFFECTIVE values: a 4s
ceiling resolves them so a page stops waiting on an auth store that is
never going to answer. isAuthenticated was computed from the RAW store,
so it opted itself out of the ceiling that every other field honours.

/timeline renders `isLoading ? spinner : !isAuthenticated ? spinner :
content`. The ceiling cleared the first gate after 4s; the second stayed
shut forever. It never redirected either, because the redirect only
fires when there is no user — and there was one, which is why the header
rendered notifications the whole time.

Measured live before the fix, on a fully signed-in session:

  domInteractive         903ms
  all support API calls  done by 2.1s
  feed request           NEVER MADE
  long tasks             none
  articles after 122s    0

Zero network and zero long tasks is what distinguishes this from a
performance problem. Nothing was slow; nothing was running at all. The
same page had rendered in ~10s on other loads, which is what made it
look like variable slowness rather than a stuck gate.

`!!user` is unchanged and still does the real work: a timed-out ceiling
can only report authenticated for someone who already has a user object,
and the "no user" case is asserted so the ceiling can never invent a
session.

The hook had no tests at all despite gating every authenticated page.
Proven by mutation: restoring the raw flags fails the
"lets a signed-in user through" case and only that one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012dpTLxh5GJWeWTF1UEvcD5
@github-actions
github-actions Bot merged commit af309bd into main Aug 28, 2026
6 checks passed
@github-actions
github-actions Bot deleted the fix/auth-ceiling branch August 28, 2026 12:59
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.

1 participant