-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(rhineng-13316): fix systems count discrepancy #2171
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2171 +/- ##
=======================================
Coverage 67.14% 67.14%
=======================================
Files 130 130
Lines 3476 3476
Branches 1106 1107 +1
=======================================
Hits 2334 2334
Misses 1142 1142 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe what youre finding is a symptom and not a root cause. I believe the root cause is because we hard code the filter in cveDetailHelpers, for fetchHybridSystemsCount. So while inventory/other request get updated with filters, that one count never gets updated.
vulnerability-ui/src/Components/SmartComponents/CVEDetailsPage/cveDetailHelpers.js
Line 10 in 56b25c8
const filters = { id: cveName, limit: 1, advisory_available: true }; |
Im not against just using one, but id ask the backend folks if this count is accurate.
@adonispuente I finally got some free time to check back on this PR. My opinion still stands –> it doesn't matter that one thing is not updated when the other does. I asked the Vuln team, and they said that the isEdgeParityEnabled flag could be removed, so we don't need to make 3 requests instead of one. I think we need to review this PR, merge it. Check that the bug is fixed. In the next PR I will remove the isEdgeParityEnabled flags that are leftovers from when it was implemented. |
@Fewwy |
https://issues.redhat.com/browse/RHINENG-13316
I discovered the core of the issue why this is happening, but I want to ask your advice on how to update the structure of the cvedetails page to fix this.
So, the issue is the following, in vulnerability we're using 3 different requests to grab the "total items" of systems. 2 of them are for the CVEDetailTableTitle component and they are described in fetchHybridSystemsCounts
The other one is getEntites for the CVEDetailsPage.js, the totalItems we get with useSelector from entities.total
This causes the following issue:
we render the Title "Total systems affected"
That triggers fetchHybridSystemsCounts and we get total items from that, pass it through context and render the number in title
Then inventory table renders and we fetch entities with getEntities
We get totalItems value from the redux store and render it in the table
If, for some reason the amount of total systems for this CVE changes between step 2 and 3 - we get different numbers in Title and Table
Here's an example, I console.logged values in CVEDetailTableTitle.js and totalItems in CVEDetailsPage.js. I refreshed the CVE details page several times and got a discrepancy
My fix for this - avoid using fetchHybridSystemsCount and use the one we get from get entities.