Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🔍 Overview
The console leverages the
pollInterval
option on the apollo client'suseQuery
hook on various screens to ensure that the user always sees the most recent data, such as sync status, secrets, etc. This works, but causes significant client and server load on aggregate during very long sessions where much of the polling is not required due to the tab or window being either hidden or out of focus.💡 Proposed Changes
Skip polling attempts when the tab is hidden or out of focus. This is accomplished via the new
skipPollAttempt
option foruseQuery
in apollo-client3.9.0
🖼️ Screenshots or Demo
Screencast.From.2024-12-04.11-53-40.mp4
📝 Release Notes
Skip polling the backend on various screens when the Console is hidden or out of focus
❓ Open Questions
Should polling continue when the document is out of focus but not hidden? (like in the demo above, for example)Yes
💚 Did You...
- [ ] Regenerate graphql schema and types (if required)