ADORSYS-GIS / ADORSYS-GIS/converse-frontends

[Ticket]: Summary text contradicts the state below it (0 active keys, live-spend banner)

未關閉
#356 0 則留言 0 個 reaction 已指派 1 人 已被 @stephane-segning 認領 在 GitHub 檢視
bug
主要語言
TypeScript
星號
0
分支
0
平均合併
1 小時 49 分鐘
30 天內合併 PR
253

描述

## Type

Bug

## Summary

Two claims on live screens contradict what is on the same screen:

1. **API keys** — the summary reads `0 active · 6 revoked · 1 expiring within 30 days` for an account that has a **usable** key (`Miaou`, expires 2026-09-27). "0 active" tells the user they have no working credentials when they have one.
2. **Overview** — the banner reads *"Spend, budget and project/key counts below are live."* while SPEND, SPEND SHARE and BUDGET are all showing `Request failed with status code 405`.

Both observed live on `https://console.ai.camer.digital`.

## Intent

This is the defect class Epic #260 was created to eliminate, in its last remaining form. The panels themselves are now honest — a failed usage query renders `Request failed with status code 405` with a Retry, exactly as intended, and that is a genuine improvement holding up under a real backend failure. What has not kept pace is the **summary text above them**, which still asserts a state the page below contradicts.

A reader trusts a count more readily than they re-read four panels. "0 active" is the more damaging of the two: the honest response to it is to go create a key you do not need.

## Source of truth (links)

- https://github.com/ADORSYS-GIS/converse-frontends/issues/260 (the epic whose principle this violates)
- https://github.com/ADORSYS-GIS/converse-frontends/issues/346 (same family: a claim outliving the state it describes)

## Current Behavior

**Counts.** `expiring` is a console-derived bucket, not a backend status — `ApiKey.status` is a plain `String` and the real values are `active`/`revoked`. The ledger renders `expiring` in the STATUS column and appears to subtract it from `active`, so a key that is live today and expires in 30 days is counted in neither "active" nor "revoked".

**Banner.** `USAGE_PENDING_MESSAGE` on Overview is rendered unconditionally. After #305/#306 wired the panels to real queries, the sentence "Spend, budget and project/key counts below are live" became a claim about runtime state, but it is still static text.

## Expected Behavior

- A key that can still authenticate is counted as active. Whether `expiring` stays a separate visual status is a design choice; it must not be subtracted from the count of usable keys.
- The Overview banner reflects what actually resolved: it may claim spend/budget are live only when those queries succeeded. When they fail, the panels' own error states are the truth and the banner must not contradict them.

## Acceptance Criteria

- [ ] Given one non-revoked, not-yet-expired key, the summary reports at least one active key.
- [ ] Given the usage query fails, the Overview banner does not assert that spend and budget are live.
- [ ] Given it succeeds, the banner's claim matches.
- [ ] Regression tests cover both, driven from query state rather than static copy.

## Out of Scope

- The 405 itself — that is deployment configuration (`usageUrl` points at the Expo static host, which has no usage backend behind it), tracked separately.
- The `PREFIX` column (#355).

## Technical Context

`apps/console/src/containers/use-api-keys-screen.ts` (the summary counts), `apps/console/src/containers/use-overview-screen.ts` (`USAGE_PENDING_MESSAGE`), `packages/ui-web/src/sections/api-keys-ledger/`.

## Human accountable owner

@stephane-segning

## AI Usage Declaration

Both observed during a browser pass over the live deployment, against real account data.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。