Skip to content

ROX-32864: Upgrade apollo to fix infinite spinner on VM results#19700

Open
bradr5 wants to merge 3 commits intomasterfrom
bradr/ROX-32864_fix_indefinite_loading_spinner_related_to_apollo
Open

ROX-32864: Upgrade apollo to fix infinite spinner on VM results#19700
bradr5 wants to merge 3 commits intomasterfrom
bradr/ROX-32864_fix_indefinite_loading_spinner_related_to_apollo

Conversation

@bradr5
Copy link
Copy Markdown
Contributor

@bradr5 bradr5 commented Mar 30, 2026

Description

Upgrades @apollo/client from 3.8.7 to 3.8.10 to fix a console error caused by cache override warnings that resulted in an infinite spinner on the vulnerability management results table.

The problem

When viewing the VM results table, filtering in a way that reduces the number of distroTuples on a cached ImageCVECore object triggers Apollo's "Cache data may be lost" warning. For example, a CVE with 3 distro tuples in the unfiltered results would be replaced by the same CVE with only 1 tuple after filtering by namespace — Apollo warns that cached data is being overwritten without a merge function.

Steps to reproduce:

  1. Navigate to Vulnerability Management results
  2. Set per page to 100
  3. Filter namespace to "backend"

How the bug was introduced

In 3.8.0, PR #10887 introduced a "new error extraction mechanism". This changed the cache override warning to use %s (string formatting) for cache objects. Since these objects can't be converted to a primitive value, the warning throws "Cannot convert object to primitive value" instead of logging the intended message. This error bubbles up and causes the infinite spinner.

This worked correctly in 3.7.17 and earlier because the warning used inline messages that handled object formatting properly.

In 3.8.10, PR #11483 fixed this by changing %s to %o, which displays cache objects as expandable/inspectable objects in the browser console instead of attempting string conversion.

3.7.17 (working):

Screenshot 2026-03-30 at 2 50 19 PM

3.8.7 (broken — infinite spinner):

Screenshot 2026-03-30 at 2 51 11 PM

3.8.10 (fixed):

Screenshot 2026-03-30 at 2 52 05 PM

Follow-up

This fixes the console error and the infinite spinner but does not address the underlying "Cache data may be lost" warning. A follow-up PR should add typePolicies merge functions to the Apollo cache configuration for ImageCVECore.distroTuples to eliminate the warning entirely.

User-facing documentation

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

@bradr5 bradr5 requested a review from a team as a code owner March 30, 2026 19:53
Copy link
Copy Markdown
Contributor

@pedrottimark pedrottimark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulations for your tenacity to reproduce and investigate.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.66%. Comparing base (b54b035) to head (9fa38cd).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #19700      +/-   ##
==========================================
- Coverage   49.67%   49.66%   -0.01%     
==========================================
  Files        2748     2748              
  Lines      207354   207354              
==========================================
- Hits       102995   102990       -5     
- Misses      96703    96708       +5     
  Partials     7656     7656              
Flag Coverage Δ
go-unit-tests 49.66% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rhacs-bot
Copy link
Copy Markdown
Contributor

Images are ready for the commit at 9fa38cd.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-508-g9fa38cd2fb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants