Skip to content

fix(desktop): handle missing file list directories - #34073

Closed
OpeOginni wants to merge 1 commit into
anomalyco:devfrom
OpeOginni:fix/list-empty-dir
Closed

fix(desktop): handle missing file list directories#34073
OpeOginni wants to merge 1 commit into
anomalyco:devfrom
OpeOginni:fix/list-empty-dir

Conversation

@OpeOginni

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #27056

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Issue:

When git diff contains deleted files, the Changes file tree still needs to render their original paths. To do that, it creates synthetic parent directory nodes, even though that directory may no longer exist on disk. When the synthetic directory is expanded, the frontend calls file.list for that path. The server then calls realPath on the missing directory, gets ENOENT, converts it to a defect, and returns a 500.

Fix:

  • Declared NotFoundError as a possible response for file.list.
  • Added a server-side directory existence check before calling FileSystem.list.
  • Return 404 NotFoundError when the requested list path is missing or no longer a directory.
  • Updated the frontend file tree to catch only that 404 and treat it as an empty node.
  • Regenerated SDK types so file.list includes the new 404 response.

How did you verify your code works?

Added a server test for missing directories returning 404, regenerated SDK types, and ran focused tests/typechecks.

Screenshots / recordings

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@OpeOginni OpeOginni changed the title fix: handle missing file list directories fix(desktop): handle missing file list directories Jun 26, 2026
@OpeOginni OpeOginni closed this Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Config Error on TUI is not readable like before

1 participant