Parse uploaded files one at a time so large PDF batches don't time out - #62
Merged
Conversation
A single /text/parse call carrying many large PDFs times out: Tika can
take well over a minute per big or scanned PDF, and the client's 15s
timeout with three blind retries then re-sent the whole batch while the
server was still working on the first attempt. The user saw "Something
went wrong" even though each file parses fine on its own.
Upload.js now chains one /text/parse call per file, in series, with a
progress toast ("Parsing 3 of 15: name.pdf"), shows each file as soon as
it lands, and reports which files failed instead of failing the batch.
DataContext.parse gets a generous per-file timeout and no retry, since
re-sending a PDF that just timed out only piles more work on the server.
The API caches parsed files by content, so a re-upload is instant.
Fixes #61
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
✅ Deploy Preview for harmony-staging ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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 #61.
Problem
Uploading many large PDFs sends them all in one
/text/parsecall. Tika can take well over a minute per big or scanned PDF, the client aborts at 15 s, and the retry loop then re-sends the whole batch twice more while the server is still working on the first attempt. The user sees "Something went wrong" although each file parses fine on its own (as Thomas confirmed by uploading them one by one).Fix
Upload.js: after reading the files locally, call/text/parseonce per file, in series. A progress toast showsParsing 3 of 15: name.pdf, each file appears in the editor as soon as it lands, and the final toast lists any files that failed rather than failing the whole batch.DataContext.js:parse()takes a per-file timeout (180 s) and no longer retries — re-sending a PDF that just timed out only piles more work on the server.retryablePostDatagains aretriesoption (default unchanged at 3) so nothing else changes.The API caches parsed files by content hash, so re-uploading an already-parsed file is instant.
Notes
/harmony.🤖 Generated with Claude Code