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

[8.0] Reload on inactive tabs #1761

Merged
merged 7 commits into from
Nov 7, 2019
Merged

[8.0] Reload on inactive tabs #1761

merged 7 commits into from
Nov 7, 2019

Conversation

bjoernricks
Copy link
Contributor

@bjoernricks bjoernricks commented Nov 6, 2019

Improve Reload component to consider hidden status of the current browser tab for calculating the reload interval.

Checklist:

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.
@bjoernricks bjoernricks marked this pull request as ready for review November 6, 2019 16:22
@bjoernricks bjoernricks requested a review from a team November 6, 2019 16:22
@codecov
Copy link

codecov bot commented Nov 6, 2019

Codecov Report

Merging #1761 into gsa-8.0 will increase coverage by 0.06%.
The diff coverage is 76.59%.

Impacted file tree graph

@@             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
Impacted Files Coverage Δ
gsa/src/web/pages/reports/listpage.js 8.43% <0%> (ø) ⬆️
gsa/src/web/pages/tasks/listpage.js 23.8% <0%> (ø) ⬆️
gsa/src/web/pages/tasks/detailspage.js 16.41% <0%> (ø) ⬆️
gsa/src/web/pages/reports/detailspage.js 5.21% <0%> (ø) ⬆️
gsa/src/gmp/gmpsettings.js 100% <100%> (ø) ⬆️
gsa/src/web/components/loading/reload.js 87.96% <81.08%> (-4.35%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 234e05a...3fed605. Read the comment docs.

swaterkamp
swaterkamp previously approved these changes Nov 6, 2019
gsa/src/web/components/loading/reload.js Outdated Show resolved Hide resolved
gsa/src/web/components/loading/reload.js Outdated Show resolved Hide resolved
@swaterkamp
Copy link
Member

I'm not a 100% sure about the differing intervals of 3 and 5 seconds respectively.

@bjoernricks
Copy link
Contributor Author

Currently the reload intervals are by default (via gmp settings):

  • normal -> 15 seconds
  • active -> 3 seconds
  • inactive -> 60 seconds

let us discuss them before we merge the PR.

removeVisibilityListender -> removeVisibilityListener

Co-Authored-By: Steffen Waterkamp <[email protected]>
@swaterkamp swaterkamp merged commit ed5fa1a into greenbone:gsa-8.0 Nov 7, 2019
@bjoernricks bjoernricks deleted the reload-on-inactive-tabs branch November 7, 2019 13: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