Skip to content

bug(platform): a failed project list read marks every Project budget rule "Deleted project" and says to remove it #4605

Closed

Description

@yannickmonney

Summary

When the project list fails to load, Settings > Governance > Policies & Limits relabels every Project budget rule as targeting a deleted project:

  • the rules table shows Deleted project in the Target column for every project-scoped rule;
  • editing such a rule shows the hint: "This project no longer exists, so the rule limits nothing. Choose a project or remove the rule."

Both statements are false. The project exists, and the server still enforces the rule. Following the hint leads an admin to retarget or remove a working spending cap. The project picker in the same dialog also says "No projects found".

#4505 introduced this. It is a sharper case of #4586: useProjects returns data ?? [] and exposes no error. Here the empty fallback isn't just an empty picker; it produces a deletion verdict and a destructive instruction.

Source

In services/platform/app/features/settings/governance/components/budget-editor.tsx:

  • The read (767–770): const { projects: projectRows, isLoading: projectsLoading } = useProjects(organizationId, { includeArchived: true });. useProjects (app/features/projects/hooks/queries.ts:165–177) returns projects: data ?? [] and isLoading, with no error or refetch. A settled failed read is therefore an empty list with isLoading false.
  • The table (ProjectRuleTarget, 195–212): project === undefined && !loading renders budgets.projectDeleted. The comment says "one that is gone says so … except while the project list is still loading". A failed read is treated as gone.
  • The dialog (projectGone, 461–467): scope project, a saved scopeId, !projectsLoading, and no matching project. Then the picker (578–591) shows budgets.projectDeletedHint as its description, and its emptyText is budgets.noProjectsFound.
  • Same class, pre-existing: the member, team and API key pickers in this editor read data without error state, so a failed read says "No users found", "No teams found" or "No API keys found". Lines 556, 571 and 604.

The same wording ships in German ("Gelöschtes Projekt"; "Dieses Projekt gibt es nicht mehr, darum begrenzt die Regel nichts. Wähle ein Projekt oder entferne die Regel.") and French ("Projet supprimé"; "Ce projet n'existe plus, la règle ne limite donc rien. Choisis un projet ou supprime la règle.").

Dedupe: I scanned 294 open items (129 PRs). Open PR #4567 changes budget-editor.tsx but adds no error handling, and leaves this logic unchanged.

Reproduction (expected from the code; not run live)

  1. As an admin, create a Project budget rule (feat(platform): cap what a project spends with a Project budget rule #4505) for an existing project.
  2. Reload Settings > Governance > Policies & Limits while projects/queries:listProjects fails (go offline after the policy loads, or have the backend answer with a server error).
  3. The rule's Target reads Deleted project.
  4. Edit the rule. The Project field says "This project no longer exists, so the rule limits nothing. Choose a project or remove the rule.", and its picker says "No projects found".

Expected

Regression expectation

budget-editor.test.tsx:

  • with a failed useProjects read and a saved project rule, the Target cell is not "Deleted project" and the edit dialog has no projectDeletedHint;
  • a failure message with Try again appears;
  • the existing "project really deleted" case keeps its label and hint.

Triage

Activity

  1. added
    agent-ready
    on Oct 29, 2026
  2. added a commit that references this issue on Oct 30, 2026
    cadd874
  3. added a commit that references this issue on Oct 30, 2026
    7834f6b
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