Skip to content

Add 5-minute polling fallback for webhook signal revalidation#100

Merged
stylessh merged 2 commits intomainfrom
stylessh/poll-revalidation
Apr 13, 2026
Merged

Add 5-minute polling fallback for webhook signal revalidation#100
stylessh merged 2 commits intomainfrom
stylessh/poll-revalidation

Conversation

@stylessh
Copy link
Copy Markdown
Owner

Summary

  • Adds a useGitHubSignalPoll hook that polls the server every 5 minutes to check for webhook revalidation signals that may have been missed by the WebSocket connection
  • Adds a getRevalidationSignalTimestamps server function that returns signal timestamps from the database
  • Refactors useGitHubSignalStream into three composable hooks: useGitHubSignalStreamWebSocket (existing WS logic), useGitHubSignalPoll (new polling fallback), and useGitHubSignalStream (composes both)
  • The first poll seeds timestamps without triggering invalidation to avoid false-positive refetches on mount

Test plan

  • Verify WebSocket-based revalidation still works as before
  • Simulate a missed WebSocket signal and confirm the poll catches it within 5 minutes
  • Verify the first poll does not trigger unnecessary query invalidations
  • Check debug logs for github-signal-poll entries

The WebSocket-based signal stream can miss events if the connection drops
momentarily. This adds a polling fallback that checks signal timestamps
on the server every 5 minutes and invalidates stale queries if any
signals were missed.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

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

Deploying with  Cloudflare Workers  Cloudflare Workers

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

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
diffkit ad3d8e9 Apr 13 2026, 08:55 PM

@stylessh stylessh merged commit 8fbcea1 into main Apr 13, 2026
4 checks passed
stylessh added a commit that referenced this pull request Apr 18, 2026
* Add 5-minute polling fallback for webhook signal revalidation

The WebSocket-based signal stream can miss events if the connection drops
momentarily. This adds a polling fallback that checks signal timestamps
on the server every 5 minutes and invalidates stale queries if any
signals were missed.

* Update generated route tree
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