Skip to content

fix(cli): tolerate removed files during desktop catch-up - #5350

Merged
jrusso1020 merged 1 commit into
heygen-com:mainfrom
user-github-me:fix/catch-up-file-disappearance
Oct 24, 2026
Merged

jrusso1020 merged 1 commit into
heygen-com:mainfrom
user-github-me:fix/catch-up-file-disappearance

Conversation

@user-github-me

Copy link
Copy Markdown
Contributor

When a project file is deleted between the directory listing and metadata read, hyperframes catch-up --json exits with ENOENT and prints neither the remaining changed files nor the chat history. Tolerate failed per-file metadata reads and confirm that each listed path is still a regular file, so the scan continues when a file disappears or becomes a directory.

Validation: both new regressions fail on main and pass with the fix; all 38 app-history, catch-up, and desktop-app tests pass. The built CLI reproduces exit 1 with no JSON before the fix and exit 0 with the remaining files and chat turn afterward in an isolated fixture. CLI build/typecheck, repository lint, changed-file formatting, comment checks, test reachability, and normal commit hooks pass.

Follow-up to the merged catch-up implementation in #5114. This preserves its existing directory traversal and seen-marker behavior; the file list remains a best-effort view of the project during the scan.

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the full appHistory.ts at this head. Before the fix, an lstatSync ENOENT inside the walk threw straight out of filesChangedSince, so one file vanishing between readdirSync and lstat aborted the whole catch-up. isChangedFile now swallows that per file and also re-checks isFile() on the fresh lstat, which covers the file-replaced-by-directory case the Dirent alone cannot see. Both tests inject the race through a readdirSync hook that runs after the listing, so they exercise the real window, and the file is untouched on main since #5114, so this is still needed. Need: yes · Size: ok · Reuse: matches the existing try/catch around readdirSync in the same walk · Simpler: already minimal.

— Rames

@jrusso1020
jrusso1020 added this pull request to the merge queue Oct 24, 2026
@jrusso1020
jrusso1020 removed this pull request from the merge queue due to a manual request Oct 24, 2026
@jrusso1020
jrusso1020 added this pull request to the merge queue Oct 24, 2026
Merged via the queue into heygen-com:main with commit e7f6c12 Oct 24, 2026
80 checks passed
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.

2 participants