Multiple Convex calls on SSR with Clerk auth — 5 calls, one unauthorized on refresh
Hi! I’m using TanStack Start + Convex + Clerk following official guides.
On client nav, one Convex call works fine. But on a full refresh, I see 5 identical Convex queries, and one fails with ctx.auth.getUserIdentity() = null (UNAUTHORIZED).
The failed call has the current timestamp, while the 4 others have older ones since they are cached.
Only one TanStack loader runs.
If the QueryClient has 0 gcTime this issue do not occur.
Is this expected from SSR/hydration, or could it be revalidation causing multiple Convex hits? Any ideas how to prevent duplicates, preventing failed calls, but not killing the gcTime?
1 Reply
genetic-orange•2mo ago
please ask in #start-questions next time
can you show some code? ideally a full project