fix(splitter): 🐛 Add file availability pre-check and upload validation for Windows #23
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.
Summary
FileWaitUtilwith retry logic to handle Windows antivirus scanning delays and filesystem sync issues that cause "PDF file not found" errorsuploadFileContenthandlerTaskRepository.createignoring caller-providedidandstatusvaluesChanges
Core - File Wait Utility (New)
FileWaitUtil.ts: Shared static utility that retries file access checks (5 attempts, 1s interval) with diagnostic logging when files are not foundCore - Splitters
PDFSplitter.ts: IntegrateFileWaitUtil.waitForFile()pre-check before PDF processingImageSplitter.ts: IntegrateFileWaitUtil.waitForFile()pre-check, remove redundantfs.accesscallMain - File Upload Handlers
file.handler.ts: Addfs.accessSync(W_OK)directory writability check, post-copy/write file existence and size verification, diagnostic logging, andpath.basename()sanitization for drag-and-drop filenamesCore - Task Repository
TaskRepository.ts: Use caller-providedid(fallback touuidv4()), use nullish coalescing (??) forprogressandstatusinstead of hardcoded valuesTests
FileWaitUtil,fs.accessSync, andfs.constantsacross 4 test filesMotivation
Users on Windows reported task failures with "PDF file not found" after uploading files. The issue could not be reproduced in development but is likely caused by environmental factors such as antivirus software temporarily locking newly copied files, directory write permission restrictions, or filesystem sync delays.
Test Plan
tsc --noEmit)Refs #20
🤖 Generated with Claude Code