Skip to content

Fix Worker hang and hydration mismatches on protected routes#70

Merged
stylessh merged 3 commits intomainfrom
stylessh/fix-worker-hang
Apr 11, 2026
Merged

Fix Worker hang and hydration mismatches on protected routes#70
stylessh merged 3 commits intomainfrom
stylessh/fix-worker-hang

Conversation

@stylessh
Copy link
Copy Markdown
Owner

Summary

  • Non-blocking detail loaders: PR/issue/review detail routes now use prefetchQuery instead of await ensureQueryData, so navigation is never blocked by server function RPCs. Cached data displays instantly with background revalidation; cache misses show the skeleton.
  • Fix hydration mismatches: Gated dashboard counts on hasMounted and provided a proper server snapshot for useTabs so the server and client first render produce identical HTML.
  • Serialize concurrent RPCs: Revalidation polling now invalidates tab queries one at a time (instead of all in parallel) with a 5s initial delay. Route preloading is also serialized to avoid overwhelming the Worker.
  • Remove forced refetches: Dropped refetchOnMount: "always" and refetchOnWindowFocus: "always" from detail/page query options — webhook-based revalidation signals handle freshness, so staleTime is sufficient.
  • GitHub request policy: Added a shared 12s AbortSignal.timeout and bounded retries for all Octokit requests to prevent individual API calls from hanging the Worker.
  • Pin TanStack versions: Replaced "latest" with ~ pinned versions to prevent surprise breakage from upstream releases.

Test plan

  • pnpm --filter @diffkit/dashboard check-types
  • pnpm --filter @diffkit/dashboard lint
  • pnpm --filter @diffkit/dashboard build
  • pnpm --filter @diffkit/dashboard test
  • Manual: verify no hydration warnings in browser console on initial load
  • Manual: navigate to a PR detail page — should show skeleton or cached data instantly without blocking
  • Manual: verify revalidation polling updates data silently without loaders

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 11, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
diffkit 831e2ad Commit Preview URL

Branch Preview URL
Apr 11 2026, 06:24 PM

@stylessh stylessh merged commit 10bada6 into main Apr 11, 2026
4 checks passed
stylessh added a commit that referenced this pull request Apr 18, 2026
* Fix Worker hang and hydration mismatches on protected routes

* Update lockfile for pinned TanStack versions
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