#57250·rancher

[steve] Watching counts via websocket do not push updates for CRDs added after watch starts

Author: mallardduckCreated Sep 11, 2026Updated Sep 17, 2026

Issue

The /v1/counts endpoint includes an aggregated count of all resource types in the cluster. When a new CRD is installed (e.g., resources.cattle.io.resourceset from rancher-backup operator) and resources of that type are created, the COUNT structure gains a new property. However, Steve's websocket subscription does not broadcast this structural change to connected clients.

Describe the Bug

The most obvious issue can be observed with Rancher Backup. If a user installs Rancher Backup (BRO) their UI will already be connected to counts API with stale data. When the user attempts to create a Backup the UI will present them an error:

You must define a ResourceSet in this namespace to create a backup CR.

This is a false positive, the 3 BRO CRDs just got installed and the 2 default ResourceSet CRs created. However if a hard refresh is done on the page it generally resolves the issue immediately.

When the UI gracefully navigates to the Create Backup page it will never observe the ResourceSets in websocket events. More specifically Steve simply will not include the new CRDs in the counts for the UI to observe.

Root Cause

Steve's websocket watch mechanism treats COUNT as a single resource object and only sends updates when the resource itself changes (metadata/version), not when new properties are added to its contents. This means:

  • The COUNT resource ID/metadata doesn't change
  • Only the contents gain a new property key
  • Websocket watches resource-level changes, not property-level mutations
  • Clients maintain stale COUNT data until they make a fresh HTTP request

Expected Results

When a new resource type appears in COUNT, Steve should broadcast a websocket update to all subscribed clients so their cached COUNT reflects the current state.

Actual Results

Websocket subscribers receive no update when COUNT gains new resource type properties. Clients must make a fresh HTTP request to get updated COUNT structure.

Impact/Technical Details

  • UI components that rely on COUNT for conditional rendering show stale state during navigation
  • Inconsistent behavior between hard refresh (works) and UI navigation (broken)
  • Affects any newly installed CRDs/operators after initial dashboard load
  • Direct API calls to Rancher show correct COUNT
  • COUNT is watched by default in dashboard (opt.watch !== false)