-
Notifications
You must be signed in to change notification settings - Fork 95
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
[8.0] Reload on inactive tabs #1761
[8.0] Reload on inactive tabs #1761
Conversation
Add reloadIntervalActive and reloadIntervalInactive settings.
1. default reload interval -> used by default (15 seconds) 2. reload interval active -> used when an "active" process like scan is running (3 seconds) 3. reload interval inactive -> used when a page will "inactive" (60 seconds)
Add handlers for visibility changed events. If the current window/tab gets hidden the next reload interval will be "inactive" (60 seconds). If the window/tab gets activated again to current timer will be aborted and a new timer will be started. This new timer can be an active (3 seconds) or default (15 seconds) reload timer depending on the current page state.
Some of the behavior is tested only indirectly (e.g the exact used interval) because with class components it isn't possible to access and test internals.
Codecov Report
@@ Coverage Diff @@
## gsa-8.0 #1761 +/- ##
===========================================
+ Coverage 39.91% 39.98% +0.06%
===========================================
Files 965 965
Lines 22098 22134 +36
Branches 6254 6245 -9
===========================================
+ Hits 8821 8850 +29
- Misses 12020 12026 +6
- Partials 1257 1258 +1
Continue to review full report at Codecov.
|
I'm not a 100% sure about the differing intervals of 3 and 5 seconds respectively. |
Currently the reload intervals are by default (via gmp settings):
let us discuss them before we merge the PR. |
removeVisibilityListender -> removeVisibilityListener Co-Authored-By: Steffen Waterkamp <[email protected]>
Improve Reload component to consider hidden status of the current browser tab for calculating the reload interval.
Checklist: