Skip to content

Fix polling on vuln details page

Savas Vedova requested to merge fix-poll-on-vuln-details-page into master

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

fix-poll-bug

How to set up and validate locally

  1. Clone https://gitlab.com/gitlab-examples/security/security-reports/
  2. Run the pipeline by going into Your project > CI/CD > Pipelines
  3. Click on run pipeline for master branch
  4. Go to Security & Compliance > Vulnerability Report > Click on a Vulnerability
  5. Change the state, it will generate a history entry
  6. 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.

Merge request reports