Skip to content

feat(poll): enables background refresh when tab is hidden#45

Merged
wgordon17 merged 6 commits intogordon-code:mainfrom
wgordon17:feat/background-refresh
Apr 3, 2026
Merged

feat(poll): enables background refresh when tab is hidden#45
wgordon17 merged 6 commits intogordon-code:mainfrom
wgordon17:feat/background-refresh

Conversation

@wgordon17
Copy link
Copy Markdown
Member

@wgordon17 wgordon17 commented Apr 2, 2026

Summary

  • Removes visibility guard from full poll so it continues fetching in background tabs — but only when the notifications gate is available (304 responses make this near-zero cost)
  • When notifications gate is disabled (fine-grained PAT or missing scope), background polling pauses to conserve API budget; catch-up fetch on tab return ensures data freshness
  • Retains visibility guard in hot poll (30s) — visual-only feedback has no value in hidden tabs
  • Retains visibilitychange catch-up handler as safety net for browser tab throttling (Safari purge, Chrome Energy Saver)

Removes visibility guards that skipped API fetches when the browser tab was not visible. Both the full poll (5-min interval) and hot poll (30s interval) now continue fetching in the background. The existing visibilitychange catch-up handler is retained as a safety net for Safari tab purge and Chrome Energy Saver freeze scenarios.
@wgordon17 wgordon17 merged commit 56b4ae0 into gordon-code:main Apr 3, 2026
1 check passed
@wgordon17 wgordon17 deleted the feat/background-refresh branch April 8, 2026 17:00
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