Repository navigation
Fail closed when a discovered route module cannot be read - #791
Conversation
compileRouteGraph treated every readFile failure as a racing deletion. Keep ENOENT as a silent skip so extract/validate match a later snapshot, and propagate other I/O errors through the existing isErrno helper. Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
🦋 Changeset detectedLatest commit: 3881ffc The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
commit: |
Replace the chmod/EACCES case, which is skipped under root and unreliable on Windows, with a deterministic unlink-then-directory race via mutateDiscoveredSource. Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3881ffc785
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return undefined; | ||
| } catch (error) { | ||
| if (isErrno(error, 'ENOENT')) return undefined; | ||
| throw error; |
There was a problem hiding this comment.
Document unreadable route failures in both locales
When a discovered route module produces EACCES, EIO, or another non-ENOENT read error, this new throw changes the observable behavior of the public compileRouteGraph API and the build, inspect, and validate flows, but the commit does not update a matching page under either website/docs/en/** or website/docs/zh/**. Document the new fail-closed behavior in both locales so users know these commands no longer treat unreadable route modules as absent.
AGENTS.md reference: AGENTS.md:L89-L95
Useful? React with 👍 / 👎.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
compileRouteGraphtreated everyreadFilefailure as a racing deletion. That madeEACCES/EIO/EMFILElook like a vanished module: extract and validate skipped, andinspect/validatereported no error.Change
readRouteModuleTextnow uses the existingisErrnohelper — the same disappearance check asdiscoverStateandreadProjectIgnoreRules.ENOENTundefinedtext). Extract/validate stay off, same as a later snapshot that no longer lists the file.EACCES,EIO,EMFILE,EISDIR,ENOTDIR,EPERM, uncoded errors, …)ABxxxx— route graph has no unreadable-source diagnostic, and this PR does not invent one.Tests
EISDIR) rejectscompileRouteGraphinstead of omitting the module. This is deterministic across platforms; it does not depend onchmod 000.Local proof (after
pnpm build):Draft only; do not merge.