Uploaded image for project: 'Subscription Watch'
  1. Subscription Watch
  2. SWATCH-4518

Unlimited subscriptions incorrectly show capacity numbers in UI graphs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Normal Normal
    • Next - API
    • None
    • swatch-contracts
    • None
    • Swatch Lightning Sprint 9

      We've discovered that the capacity API isn't correctly identifying unlimited subscriptions, which causes the UI to display misleading capacity numbers instead of showing these subscriptions as unlimited.

      When customers have subscriptions with unlimited usage (like certain RHEL or OpenShift enterprise SKUs), our system should tell the UI to hide the numeric capacity values and show an "unlimited" indicator instead. However, there's a bug in our V1 capacity API endpoint (/api/rhsm-subscriptions/v1/capacity/products/PRODUCT_ID/METRIC_ID) that always returns has_infinite_quantity=false, even for unlimited subscriptions.

      This happens because the backend code that looks for unlimited subscriptions (SubscriptionRepository.findUnlimited()) incorrectly filters them by requiring measurement data. Since unlimited subscriptions don't have numeric measurements (they're unlimited!), they get excluded from the results. The consequence is that the frontend never receives the signal to display these subscriptions as unlimited, so users see zero or incorrect capacity numbers instead of an unlimited indicator.

      Actual behaviour for unlimited subscriptions in the UI:

      Note the zero value.

      Expected behaviour for unlimited subscriptions:

      Note the infinite symbol.

      The above also confirms that the UI behaves correctly, but the backend does not return correct data.
      Also, the affected API is the capacity endpoint, not the subscriptions API.

      Acceptance Criteria

      • Fix the issue and enable the tests that were written for SWATCH-4297.

              jcarvaja@redhat.com Jose Carvajal Hilario
              jcarvaja@redhat.com Jose Carvajal Hilario
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: