Skip to content

Fix Infinity % / Infinity % on Stacked Progress Bar

Zack Cuddy requested to merge 7707-fix-infinity-progress into master

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 Infinity_Percentage_Bug
after Inifity_Percentage_Bug_-_Fixed

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

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)

Merge request reports