fix(checks list): scope summary bar counts to filtered checks#1289
Closed
checkly-rca-bot-angie[bot] wants to merge 1 commit intomainfrom
Closed
fix(checks list): scope summary bar counts to filtered checks#1289checkly-rca-bot-angie[bot] wants to merge 1 commit intomainfrom
checkly-rca-bot-angie[bot] wants to merge 1 commit intomainfrom
Conversation
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)
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:Root Cause
api.checkStatuses.fetchAll()has no filter — it always returns every check status. TheactiveCheckIdsoptional parameter onformatSummaryBaralready 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 asactiveCheckIdswhen any filter is active, so counts reflect only visible checks.formatters/checks.ts— always usetotalChecks(server-reported) for the(N total checks)display, notactiveCheckIds.size(page count).Result:
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 🔎