Skip to content

bug(platform): API key owner pickers say no member, team or project qualifies while the list loads or after it fails to load #4586

Closed

Description

@yannickmonney

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

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.
    • useOrgTeams returns isLoading, isError and refetch.
    • useOrgMembersForPicker returns the full query result.
    • useProjects exposes only isLoading, so it needs isError and refetch added.
    • Other consumers of useOrgTeams read at least isLoading, for example skill-visibility-field.tsx:66, document-upload-dialog.tsx:74 and google-drive-import-dialog.tsx:126.
  • Not tested: api-key-create-dialog.test.tsx mocks 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)

  1. As an Admin, open Settings > API > REST and select New API key.
  2. Under Belongs to, choose Another member while the organization's member list can't load (offline, or governance/legal_hold_queries:listOrgMembersForPicker answers with a server error).
  3. Open the Member picker. It says "No member whose role is below yours", even if such members exist.
  4. 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.rest UX-CLARITY and REL-MANUAL. Found by Review A (TALE-358) at the 2026-10-09 00:15 Europe/Zurich occurrence.

Activity

  1. added
    agent-ready
    on Oct 29, 2026
  2. added a commit that references this issue on Oct 30, 2026
    12fcc52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readybug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions