Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: active polling #403

Merged
merged 3 commits into from
Dec 5, 2024
Merged

feat: active polling #403

merged 3 commits into from
Dec 5, 2024

Conversation

rohan-chaturvedi
Copy link
Member

@rohan-chaturvedi rohan-chaturvedi commented Dec 4, 2024

🔍 Overview

The console leverages the pollInterval option on the apollo client's useQuery 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 for useQuery in apollo-client 3.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...

  • Ensure linting passes (code style checks)?
  • Update dependencies and lockfiles (if required)
    - [ ] Regenerate graphql schema and types (if required)
  • Verify the app builds locally?
  • Manually test the changes on different browsers/devices?

@nimish-ks
Copy link
Member

SovietUniton Integration lmfao

@rohan-chaturvedi
Copy link
Member Author

image

@nimish-ks nimish-ks merged commit 25c8e0c into main Dec 5, 2024
6 checks passed
@nimish-ks nimish-ks deleted the feat--active-polling branch December 5, 2024 07: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.

2 participants