Skip to content

🤖 fix: unreadable config.json gives null getInfo and misleading edit errors #5757

Description

@ThomasK33

Problem

When config.json cannot be read (EACCES) or does not parse, the backend gives unclear results. The behavior is the same on main 0c5e35d816 and on the head of #5750, so that PR does not cause it. Remote UAT for #5750 found it.

  1. workspace.getInfo returns HTTP 200 with a null body for a workspace that is still registered on disk. The renderer cannot tell "unreadable config" from "workspace removed".
  2. A rejected edit after an EACCES read says the existing corrupt config has no confirmed backup yet. Fix the reported backup failure or move the corrupt file aside. The file is not corrupt. It is only unreadable, and the load log already says so.
  3. A second edit in the same window fails with Workspace not found instead of the config-load reason.

When the file is readable again, the next edit succeeds without a restart. Recovery works; only the reported state is wrong.

Repro (synthetic fixture, non-root user)

  1. Generate a fixture: bun scripts/perf/workspace-scale/generate-fixture.ts --root <new dir> --workspaces 4700 --projects 19 --archived 0.57 --profile realistic.
  2. Start node dist/cli/index.js server --no-auth with XUM_ROOT=<new dir> and XUM_MOCK_AI=1.
  3. chmod 000 <root>/config.json.
  4. POST /api/workspace/updateTitle {"workspaceId": <id>, "title": "x"} returns {"success":false,"error":"...the existing corrupt config has no confirmed backup yet..."}.
  5. POST /api/workspace/getInfo {"workspaceId": <id>} returns HTTP 200 with body null.
  6. A second updateTitle returns {"success":false,"error":"Workspace not found"}.

Expected

  • getInfo reports a config-load error instead of null.
  • The edit refusal names the real cause (unreadable file) and does not tell the user to move a corrupt file aside.
  • Later edits in the window report the same config-load cause, not "Workspace not found".

Out of scope

An in-place edit that keeps inode, size and mtime stays invisible until the next save. That is the existing stat-key limit of the config snapshot, not this issue.

Refs #5750


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions