Skip to content

fix(checks list): scope summary bar counts to filtered checks#1289

Closed
checkly-rca-bot-angie[bot] wants to merge 1 commit intomainfrom
angie/fix-checks-list-summary-bar-filter
Closed

fix(checks list): scope summary bar counts to filtered checks#1289
checkly-rca-bot-angie[bot] wants to merge 1 commit intomainfrom
angie/fix-checks-list-summary-bar-filter

Conversation

@checkly-rca-bot-angie
Copy link
Copy Markdown

Summary

When running checkly checks list --status failing (or any filter), the summary bar showed counts from all checks in the account while the total came from the filtered API response — producing a confusing mismatch:

✓ 6 passing    ✗ 1 failing    (1 total checks)

Root Cause

api.checkStatuses.fetchAll() has no filter — it always returns every check status. The activeCheckIds optional parameter on formatSummaryBar already existed for exactly this purpose but was never wired up from the list command.

Fix

Two small changes:

commands/checks/list.ts — pass current page check IDs as activeCheckIds when any filter is active, so counts reflect only visible checks.

formatters/checks.ts — always use totalChecks (server-reported) for the (N total checks) display, not activeCheckIds.size (page count).

Result:

# Before (--status failing, 1 of 7 failing):
✓ 6 passing    ✗ 1 failing    (1 total checks)   ← confusing

# After:
✗ 1 failing    (1 total checks)                   ← consistent

A regression test is included in checks.spec.ts.

Context

Reported in #cli — screenshot showing broken summary bar with checkly checks list --status failing.


Created by Angie 🔎

When running `checkly checks list --status failing` (or any filter),
the summary bar showed counts from ALL checks in the account (e.g.
"6 passing  1 failing") while the total came from the filtered API
response (e.g. "1 total checks"), producing a confusing mismatch.

Root cause: `api.checkStatuses.fetchAll()` has no filter and always
returns every check status. The `activeCheckIds` optional parameter
on `formatSummaryBar` already existed for this purpose but was never
passed from the list command.

Fixes:
- Pass current page check IDs as `activeCheckIds` when any filter is
  active so the passing/failing counts reflect only the visible checks.
- Always use `totalChecks` (server-reported filtered total) for the
  "(N total checks)" display, not `activeCheckIds.size` (page count).

Before (with --status failing):
  ✓ 6 passing    ✗ 1 failing    (1 total checks)

After:
  ✗ 1 failing    (1 total checks)
@stefanjudis stefanjudis deleted the angie/fix-checks-list-summary-bar-filter branch April 22, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant