Repository navigation
fix(cli): tolerate removed files during desktop catch-up - #5350
Merged
jrusso1020 merged 1 commit intoOct 24, 2026
Merged
Conversation
jrusso1020
approved these changes
Oct 24, 2026
jrusso1020
left a comment
Collaborator
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a project file is deleted between the directory listing and metadata read,
hyperframes catch-up --jsonexits withENOENTand 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.