Skip to content

fix(claw): continue gateway polling when browser tab is inactive#2393

Merged
RSO merged 1 commit intomainfrom
fix/claw-provisioning-background-polling
Apr 14, 2026
Merged

fix(claw): continue gateway polling when browser tab is inactive#2393
RSO merged 1 commit intomainfrom
fix/claw-provisioning-background-polling

Conversation

@kilo-code-bot
Copy link
Copy Markdown
Contributor

@kilo-code-bot kilo-code-bot bot commented Apr 14, 2026

Summary

The provisioning step's gateway-ready polling (useClawGatewayReady) uses TanStack Query's refetchInterval to poll every 5 seconds, but by default TanStack Query pauses interval-based refetching when the browser tab is inactive. This caused two user-facing issues:

  • The ready chime doesn't play until the user refocuses the tab
  • The loading spinner never resolves while the tab is in the background

Fixed by adding refetchIntervalInBackground: true to both the personal and org query variants in useClawGatewayReady, so polling continues regardless of tab visibility.

Verification

  • Reviewed TanStack Query docs confirming refetchIntervalInBackground default is false
  • Verified the change is limited to the gateway-ready polling hook
  • Typecheck not runnable in CI environment (missing tsgo), but change is a single boolean option addition with no type implications

Visual Changes

N/A

Reviewer Notes

This is a one-line fix per query variant. The refetchIntervalInBackground option is only meaningful when refetchInterval is active (i.e. when enabled is true), so it has no effect on disabled queries.


Built for Remon Oldenbeuving by Kilo for Slack

Enable refetchIntervalInBackground on the gateway ready polling query
so provisioning status updates continue when the tab loses focus.
Without this, the chime and spinner completion are delayed until the
user refocuses the tab.
@kilo-code-bot
Copy link
Copy Markdown
Contributor Author

kilo-code-bot bot commented Apr 14, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 files)
  • apps/web/src/app/(app)/claw/hooks/useClawHooks.ts

Reviewed by gpt-5.4-20260305 · 162,639 tokens

@RSO RSO merged commit dfa2a8a into main Apr 14, 2026
15 checks passed
@RSO RSO deleted the fix/claw-provisioning-background-polling branch April 14, 2026 12:30
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