The policy list intermittently shows policies from recently removed security policy project

Summary

When removing a security policy project (SPP), some policies are not removed from the policy list until a page refresh because the removal of the SPP happens as a background job, which is why the success banner says The SPP will be removed shortly.

If you are like, who doesn't read the banners, but only looks at the colors, this can be confusing. Plus policies are left in the list when they should be removed and they won't be removed until a page refresh

Steps to reproduce

1.Upload a GitLab Ultimate license

  1. Navigate to a project => Secure => Policies
  2. Link a security policy project
  3. Unlink the security policy project

Example Project

https://staging.gitlab.com/govern-team-test/alexander-test-group/security-reports/-/security/policies

What is the current bug behavior?

Policies from the SPP appear in the list after deletion

What is the expected correct behavior?

Policies from the SPP do not appear in the list after deletion

Relevant logs and/or screenshots

intermittently_shows_policies_small

Possible fixes

The requests happen in ee/app/assets/javascripts/security_orchestration/components/policies/app.vue, so I would start there and inspect the graphql queries

  • backend implement a graphql subscription to broadcast when the SPP is removed
  • frontend listen for the graphql subscription and update the policy list when the SPP has been removed
Edited by 🤖 GitLab Bot 🤖