Observation
On the application detail page for Permit Flow (uuid `09f72a5f-b0f9-45e5-8120-b1030694ab50`), all three KPI cards on the version-pill row show identical numbers regardless of which version is selected:
| Version (pill) |
URL |
Active users |
Object count |
Files |
Audit events |
| Production |
(no `?_version=`) |
0 |
246 |
0 |
0 |
| Development |
`?_version=development` |
0 |
246 |
0 |
0 |
| Staging (not retested but expected same) |
… |
… |
… |
… |
… |
The newly seeded development register `openbuilt-permit-flow-development` should be empty, so `object count: 246` is wrong.
Suspected root cause
`ApplicationInsightsController` / its underlying service probably ignores the `versionUuid` URL path segment and aggregates the whole `openbuilt` register (or the whole organisation) instead of the per-version register `openbuilt-permit-flow-{tier}`.
Need to:
- Trace `GET /api/applications/{appUuid}/versions/{versionUuid}/insights`
- Verify the underlying counter queries scope by the version's `register` field, not the global `openbuilt` register.
- Add a unit test that distinguishes per-tier counts.
Repro
- Wizard-create app with 3 tiers (development, staging, production).
- Open detail page.
- Switch between pills.
- KPIs should reflect each tier's register; instead all read 246.
Surfaced while verifying #74 (dev → staging → prod workflow).
Observation
On the application detail page for Permit Flow (uuid `09f72a5f-b0f9-45e5-8120-b1030694ab50`), all three KPI cards on the version-pill row show identical numbers regardless of which version is selected:
The newly seeded development register `openbuilt-permit-flow-development` should be empty, so `object count: 246` is wrong.
Suspected root cause
`ApplicationInsightsController` / its underlying service probably ignores the `versionUuid` URL path segment and aggregates the whole `openbuilt` register (or the whole organisation) instead of the per-version register `openbuilt-permit-flow-{tier}`.
Need to:
Repro
Surfaced while verifying #74 (dev → staging → prod workflow).