Repository navigation
Description
Summary
When an Owner or Admin makes an API key for someone else, the Belongs to pickers can't tell "nobody qualifies" from "the list hasn't loaded" or "the list failed to load". In both of those cases, the picker states that no one qualifies:
- Another member: "No member whose role is below yours";
- A team: "No teams";
- A project: "No active projects".
The sentence shows while the read is pending or retrying. After a failed read it stays. Nothing says the list failed, and there is no Try again. The dialog can't be submitted without a target ("Choose whom the key belongs to."), so the admin is left at a false dead end. They may conclude that the member, team or project can't get a key.
The same class of defect is open elsewhere: #3857 (the data-subject request dialog shows "No matching members" after a failed member read; fix PR #4325) and #3843 (list reads rendered as empty collections). This is a new instance on the surface #4501 added.
Source
origin/main66162f288762bf4e4fe14b2d2d8400ae3ea0caa5(feat(platform): make API keys for members, teams, projects and the org #4501 merged).- This is a deterministic code path, read statically. No running stack was used: Review A has no stack reservation this occurrence.
In services/platform/app/features/settings/api-keys/components/api-key-owner-field.tsx:
| Picker | Read | What a pending or failed read becomes | Text shown |
|---|---|---|---|
MemberPicker (203) |
const { data: members } = useOrgMembersForPicker(organizationId); (220) |
members is undefined, so (members ?? []) gives no options |
apiKeys.form.memberEmpty (245) |
TeamPicker (262) |
const { teams } = useOrgTeams(); (272) |
teams is data ?? undefined, so (teams ?? []) gives no options |
apiKeys.form.teamEmpty (285) |
ProjectPicker (297) |
const { projects } = useProjects(organizationId); (309) |
projects is data ?? [] |
apiKeys.form.projectEmpty (326) |
- Not used: loading, error and retry state.
useOrgTeamsreturnsisLoading,isErrorandrefetch.useOrgMembersForPickerreturns the full query result.useProjectsexposes onlyisLoading, so it needsisErrorandrefetchadded.- Other consumers of
useOrgTeamsread at leastisLoading, for exampleskill-visibility-field.tsx:66,document-upload-dialog.tsx:74andgoogle-drive-import-dialog.tsx:126.
- Not tested:
api-key-create-dialog.test.tsxmocks the three hooks with loaded data only (lines 26, 56, 59), so neither the pending nor the failed state is covered.
The same sentences ship in German ("Kein Mitglied mit einer niedrigeren Rolle als deiner", "Keine Teams", "Keine aktiven Projekte") and French ("Aucun membre dont le rôle est inférieur au tien", "Aucune équipe", "Aucun projet actif").
Reproduction (expected from the code; not run live)
- As an Admin, open Settings > API > REST and select New API key.
- Under Belongs to, choose Another member while the organization's member list can't load (offline, or
governance/legal_hold_queries:listOrgMembersForPickeranswers with a server error). - Open the Member picker. It says "No member whose role is below yours", even if such members exist.
- Choose A team or A project under the same conditions: "No teams" or "No active projects".
Expected
- Pending: the picker shows a loading state, not the empty sentence.
- Failed: it says the list couldn't load and offers Try again (
refetch). Open PR fix(platform): recover failed erasure subject directory reads #4325 (Closes #3857) takes this approach for the data-subject request dialog. - Empty: the empty sentence appears only after a successful read that returned no candidates.
Regression expectation
A jsdom test of the create dialog (or ApiKeyOwnerField) for each picker:
- Failed read: shows the failure text and Try again, and not the empty sentence. Try again refetches.
- Pending read: doesn't show the empty sentence.
Triage
- Severity: low. It needs a slow or failed read, and reopening after a refresh recovers. While it lasts, though, the dialog states something false and offers no way forward.
- Owner: the platform owner of API key settings (feat(platform): make API keys for members, teams, projects and the org #4501).
- Review A cells:
api.restUX-CLARITY and REL-MANUAL. Found by Review A (TALE-358) at the 2026-10-09 00:15 Europe/Zurich occurrence.
Activity
fix(platform): tell unloaded API key owner lists apart from empty ones