Skip to content

Reduce onboarding verify-console polling #8154

Description

@talissoncosta

The verify console polls GET environments/{key}/onboarding-status/ every 3s for as long as /getting-started is open, so a tab left open without wiring up an SDK costs roughly 1,200 requests an hour. Raised by @Zaimwa9 on #8132.

Describe the solution you'd like.

Now that #8139 has landed us on RTK 2, two changes in useOnboardingConnection.ts:

pollingInterval: 5000,
skipPollingIfUnfocused: true,

skipPollingIfUnfocused pauses while the tab is hidden and resumes on return. It keys off visibilitychange rather than window blur, so a browser visible on a second screen keeps polling and can't show a stale "listening" badge.

Describe alternatives you've considered

A hard cap on polls. Rejected: someone can take twenty minutes to wire up their app, and stopping leaves a console that never flips.

Additional context

  • Background tab: no requests. Second monitor, unfocused: still polls, still flips.
  • isError is still ignored, so a 404 reads as "still listening". Tracked separately.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions