Skip to content
Snippets Groups Projects

Fix "Vulnerability report errors out when users select `Show 100 items` and switch tabs"

Merged Paul Gascou-Vaillancourt requested to merge 366951-vuln-report-query-complexity into master
  1. Jul 08, 2022
    • Paul Gascou-Vaillancourt's avatar
      Retrieve pageSize from local storage as soon as possible · 90ab0a39
      Paul Gascou-Vaillancourt authored
      This ensures the `VulnerabilityListGraphql` component retrieves the
      user-selected page size from the local storage as soon as it initializes
      its state. This ensures that the GraphQL query won't be fire twice: once
      with the default page size, and a second time when the LocalStorageSync
      emits an event with the actual size from the local storage.
      
      Changelog: fixed
      EE: true
      90ab0a39
    • Paul Gascou-Vaillancourt's avatar
      Add a test for when page size is retrieved from local storage · b6ad909b
      Paul Gascou-Vaillancourt authored
      This adds a test to ensure the vulnerabilities query is only triggered
      once with the correct `first` parameter when the page size is set in the
      local storage. This covers a bug that was uncovered recently and that
      results in the query being triggered twice when the component mounts
      because it first tries to get the default page size, and immediately
      makes another attempt with the page size retrieved by the
      LocalStorageSync component.
      This test voluntarily fails in this revision, the next commit will fix
      the component to make this test pass.
      b6ad909b
Loading