Fix polling on vuln details page
What does this MR do and why?
This MR fixes a poll bug which happens when a user switches the tab. We use visibilityjs
to bind a listener so that when the user puts the window into background we stop polling. Just figured out together with @dpisek that when we deregister, somehow we stop rebinding the listener.
Screenshots or screen recordings
How to set up and validate locally
- Clone https://gitlab.com/gitlab-examples/security/security-reports/
- Run the pipeline by going into Your project > CI/CD > Pipelines
- Click on run pipeline for master branch
- Go to Security & Compliance > Vulnerability Report > Click on a Vulnerability
- Change the state, it will generate a history entry
- Switch the tab to trigger
Visibility.change
.
Expected behaviour: It should keep polling. Actual behaviour: It stops polling.
You should have the runner installed in order to run the pipeline. Then using the following command you can register the runner, it guides you pretty good on how to set the runner:
$ gitlab-runner register
Once it's installed this is how I run the runner:
$ gitlab-runner --log-level debug run local-runner --config ~/.gitlab-runner/config.toml restart
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.