Skip to content

Conversation

@everpcpc
Copy link
Member

Summary

Fixes app crashes when workspace directories are deleted while the app is closed.

Previously, if a workspace directory was deleted externally while the app was not running, the app would fail to start or crash when trying to fetch git status for those sessions. This happened because GitStatusManager attempted to execute git commands on non-existent paths without checking if they exist first.

This PR adds filesystem existence checks (existsSync) before performing git operations in three critical locations:

  • fetchGitStatus: Before executing any git commands
  • startWatchingSession: Before starting file watchers
  • hasGitStatusChanged: Before checking for status changes

Now when a workspace directory is missing, the app will:

  • Start successfully without crashing
  • Log warnings for missing directories
  • Skip git operations for those sessions
  • Allow users to handle them gracefully through the existing error flow

Tests

  • No Test - This is a defensive fix for edge case handling. Manual testing required: delete a workspace directory while app is closed, then restart the app to verify it starts without crashing.

Type of change

  • Bug Fix (non-breaking change which fixes an issue)

Prevent app crashes when workspace directories are deleted while app is closed.
Added existsSync checks in fetchGitStatus, startWatchingSession, and
hasGitStatusChanged to gracefully handle missing worktree paths.
@everpcpc everpcpc marked this pull request as ready for review January 20, 2026 09:13
@everpcpc everpcpc merged commit d03c442 into databendlabs:main Jan 20, 2026
3 checks passed
@everpcpc everpcpc deleted the montreal-wf3574w8 branch January 20, 2026 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant