Fix Infinity % / Infinity % on Stacked Progress Bar
What does this MR do?
Fixes #7707 (closed)
There was a small bug with the vue_shared/components/stacked_progress_bar.vue
. Where if you passed a falsy
value for totalCount
but valid numbers for any of the other props, it would try to divide by 0, and then rendering as Infinity%
.
There were a couple of cases with Geo where it is valid to have a totalCount = 0
while having successfulSyncs > 0
. This would be if the secondary was still holding on to older data, but the primary has since removed it all.
Instead of digging into trying to make sure everything coming from our API was null-safe, I decided added a simple logic check to the getPercentage
function to return null
if the divisor was falsy
. This should prevent any bad data causing a confusing render of this component.
Screenshots
Infinity % Bug | |
---|---|
before | |
after |
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Closes #7707 (closed)