Repository navigation
fix(split): write split pages without cwd-relative outputFolder (#75) - #79
Merged
Merged
Conversation
…20) path.relative(cwd, taskDir) yields an absolute path across Windows drives, which pdf-to-png-converter then joins onto cwd (D:\...\C:\...). Render to buffers and write to the task dir ourselves; only report 'source file not found' when the source really is missing. Adds win32 cross-drive/UNC tests. Fixes #75
AI Code Review SummaryPR: #79 (fix(split): write split pages without cwd-relative outputFolder (#75)) Overall AssessmentNo blocking issue was detected in the reviewed diff; keep focused regression testing before merge. Major Findings by SeverityNo major issues identified from the reviewed diff. Actionable Suggestions
Potential Risks
Test Suggestions
File-Level Coverage Notes
Inline Downgraded Items (processed but not inline)
Coverage Status
Uncovered list:
No-patch covered list:
Runtime/Budget
Reasons:
|
haywolf
added a commit
that referenced
this pull request
Nov 4, 2026
Write retries reused the PDF keyword check, so an output path containing 'password' or 'encrypted' made a transient EBUSY fail at once. withRetry now takes an optional isRetryable (default: the PDF check); page writes retry on any error. Also cover the 'page has no image' branch. Follow-up to #79.
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.
Fixes #75 (also addresses #20)
Root cause:
path.relative(process.cwd(), taskDir)returns an absolute path when cwd and taskDir are on different drives. pdf-to-png-converter then joins it onto cwd, producing an invalid path likeD:\...\C:\..., which fails with ENOENT.wrapErrorthen rewrites every ENOENT as "PDF file not found".Changes
PDFSplitterno longer passesoutputFolderto the library. It renders pages to buffers and writes them itself to{userData}/files/{taskId}/split/, so nothing depends on cwd any more. This also fixes UNCuserDatapaths, which were writing into cwd and then failing with EXDEV.fs.accessconfirms the source file is actually missing.PDFSplitter.win32.test.ts(cross-drive, UNC and same-drive cases viapath.win32), a new integration test using the real library and filesystem, and 7 new unit cases.Tests:
test:unit959 passed, typecheck and build pass. With the fix reverted, 14 of 29 splitter tests fail.Not verified: a real Windows install on a non-C drive, and macOS.
Follow-up (not in this PR):
ImageSplitter.wrapErrorhas the same misleading ENOENT message.Merge order: #72 → #75 → #77 (none of the three PRs touch the same files), then run a release candidate to validate the release pipeline.