Skip to content

fix(cli): fix namespace inspect device counts#6325

Merged
otavio merged 1 commit into
masterfrom
fix/cli-namespace-inspect-device-counts
May 14, 2026
Merged

fix(cli): fix namespace inspect device counts#6325
otavio merged 1 commit into
masterfrom
fix/cli-namespace-inspect-device-counts

Conversation

@geovannewashington
Copy link
Copy Markdown
Member

What changed?

Replaced the device count display in namespace inspect with
real-time counts from store.GetStats. Added online device count
and removed the total field to align with the UI.

Why

The namespace document stores denormalized device counters that can
drift from reality, e.g. showing Pending: -1 when the actual
count is 2. Querying counts directly from the store guarantees
accurate values.

How to test

  1. Start the environment with ./bin/docker-compose up -d
  2. Run cli namespace inspect <namespace> on a namespace with
    known device counts
  3. Verify the counts match what the UI shows on the namespace
    dashboard

Replace stale denormalized counters with real-time counts from the
store via GetStats. The namespace document counters can drift from
reality over time, causing incorrect values to be displayed. Also
add online device count and drop the total field to match the UI.
@geovannewashington geovannewashington self-assigned this May 13, 2026
@geovannewashington geovannewashington requested a review from a team as a code owner May 13, 2026 19:59
@geovannewashington geovannewashington added go Pull requests that update Go code area/cli labels May 13, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 13, 2026

Claude finished @geovannewashington's task in 4m 33s —— View job


Code Review Complete

Reviewed 3 files across code quality, security, testing, Go patterns, and architecture — no issues found. The code looks good as-is.

The change correctly replaces denormalized namespace counters with live queries via store.GetStats, the Services interface addition is CLI-internal with no cross-repo impact, and the Accepted/RegisteredDevices mapping is semantically accurate (buildRegisteredDevicesQuery filters by status == accepted).


If you push additional changes and want a new review, tag @shellhub-io/admin and a team member can trigger it.

@otavio otavio merged commit 41fcb68 into master May 14, 2026
22 checks passed
@otavio otavio deleted the fix/cli-namespace-inspect-device-counts branch May 14, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cli go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants