Skip to content

BUG-81: Quotas: the range label shows the new sort or filter while the table still shows the previous rows; check 11 flakes on it #317

Closed

Description

@ephico2real2

Part of #301.

What happened. CI failed once on PR #166, head 927b05e (run 43941248868, attempt 1, job portal-ui), in check "11 Quotas" at cmapi-portal-ui/tests/api/portal.test.mjs:1183, then passed on the rerun of the same head. The records PR changes only Markdown, so the cause is in the portal or its test.

Evidence. The check clicks Sort "% used" and waits for the range text "1–25 of 70 · most used first" (:1180-1181). It then reads the rows (:1183) and expects them in most-used order. Attempt 1 read A–Z rows (accounts-api-dev, accounts-batch-dev, ...) instead of the most-used ones (checkout-api-rnd, data-worker-rnd, ...).

Cause, inferred from the code and to be confirmed. The range label follows the sort the person picked at once, while the table keeps the previous query's rows (TanStack Query keepPreviousData) until the new answer arrives. So for a moment the page shows "most used first" over A–Z rows.

  • In the test, that is a race: it waits on the label, not on the data.
  • In the portal, it is a small truth problem: the label claims an order that the rows on screen do not have yet.

Fix to research.

  • Portal: while a query's placeholder data is shown (isPlaceholderData), mark the table as busy (aria-busy, and a muted style) and keep the label of the shown rows' own query until the new rows arrive.
  • Test: wait for the rows themselves (or for aria-busy=false), never for the label alone. Check every waitQuotaRange call that a row comparison follows.

How to prove it.

  • Delay the stand-in's answer to the sort by 300 ms. Check 11 must fail on main every time; today it fails only sometimes.
  • With the fix it passes 20 of 20 runs.
  • A browser check asserts that the label and the rows agree at every step.

Activity

  1. added
    bug
    status:open
    sev:medium
    on Nov 16, 2026
  2. added
    Backlog
    on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Backlogbugsev:mediumstatus:open

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions