You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Give the pad render's owner-profile and Auth reads their own deadlines #596
A slow owner-profile read must not send the server render of an owned pad to /500. Give that read, and the Auth read, their own deadlines.
Facts
Code references are at b131fc7b1. The series ratio was measured locally on 2026-10-23; the rest is read from code.
GET /api/documents/:docName runs its upstream hops in series (measured ratio 1.04).
The server's SUPABASE_FETCH_TIMEOUT_MS = 10_000 (apps/hocuspocus.server/src/lib/supabase.ts:9) equals the webapp abort at apps/webapp/src/utils/fetchDocument.ts:85.
The server starts its deadline later. So a null profile caused by that deadline always arrives after the webapp has aborted.
So a PostgREST stall near 10 s sends every server render of an owned pad to /500, for visitors too.
The rate-limiter Redis read is a fourth hop on the same budget.
What to build
In getOwnerProfile (apps/hocuspocus.server/src/lib/profiles.ts), give the read its own deadline of about 1500–2000 ms, through .abortSignal() and controller.abort(). On timeout, render with a null owner profile.
auth-jsgetUser takes no signal. So bound the Auth hop with a timer race in optionalUser (apps/hocuspocus.server/src/api/middleware/auth.ts), mapped to unavailable.
That race must not write the negative token cache.
Out of scope
A profile TTL cache. It conflicts with Settings live sync.
Acceptance criteria
With a stalled profile read, the route answers within the new deadline, with a null owner profile.
A stalled getUser maps to unavailable, and the negative cache stays empty.
Remove the deadline locally, and see the test time out. Restore it.
The tests run in bun test on every pull request.
Effort and order
Effort S. No blocker. Impact is 2–3, because the production stall rate is unknown. #576 reads it.
Parent: #575. Source: the 2026-10-23 backend perf plan, refined on 2026-10-24.
Activity
HMarzban commentedon Oct 25, 2026
Built and committed on local main. Awaits the maintainer's final push.
Remaining gate: the backend deploy. Then the pad render answers within about 2 s when the profile or Auth read stalls.
fix(hocuspocus): give the pad render's owner-profile and Auth reads a…
perf(hocuspocus): share one Supabase Auth call across concurrent veri…
refactor: apply thermo-nuclear review round 2
refactor: deslop round 2
docs(changelog): add 2.3.0 Highlights with audited numbers