Uploaded image for project: 'OCMUI - OpenShift Cluster Manager UI'
  1. OCMUI - OpenShift Cluster Manager UI
  2. OCMUI-4038

Pagination shows incorrect count when no archived clusters are found

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • None
    • None
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • True

      Environment: Staging

      URL : /cluster-list/archives (Cluster Archives page)

      Browser: All browsers (code-level issue)

      OS: All OS

      Priority: Medium

      Reproduction Steps:

      1. Navigate to the Cluster Archives page (/cluster-list/archives)
      2. Apply filters (ex: filter by a non existing cluster name) or enable "View only my clusters" toggle such that no archived clusters match the criteria
      3. Observe the pagination component at the bottom of the page

      Current Result:

      When no archived clusters are found, the pagination still displays stale data from a previous query, showing incorrect values like:

      • "1 - 50 of 26556" even when the table shows "No archived clusters found"

      Expected Result:

      When no archived clusters are found:

      • Pagination should display "0 - 0 of 0" or be hidden entirely

      Root Cause - AI assisted (for developer reference):

      The issue is in src/components/clusters/ArchivedClusterListMultiRegion/ArchivedClusterList.jsx at lines 115-120.The useEffect that updates clustersTotal in Redux has:

      1. Incorrect condition: !isLoading || data?.itemsCount > 0 doesn't properly handle when data loads with 0 items
      1. Missing dependencies: The dependency array [data?.itemsCount] is missing isLoading, dispatch, viewType, and clustersTotal

      The active cluster list (ClusterList.jsx) has the correct implementation at lines 189-193 that should be used as reference.

        1. image-2025-12-04-16-50-57-010.png
          108 kB
          Jayakrishnan Mekkattillam

              Unassigned Unassigned
              jmekkatt@redhat.com Jayakrishnan Mekkattillam
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: