openreader/src/app/api/documents
Richard R 62c913e96d feat(pdf): refactor parse operation orchestration and client readiness flow
Introduce startPdfParseOperation to encapsulate worker operation creation, job rate tracking, and parse state initialization for PDFs. Replace scattered operation setup logic in register-upload, docx-to-pdf upload, and parse-state-backfill with this unified helper. Update job enqueuing to propagate initial opId/jobId/status for accurate state tracking.

Change getParsedPdfDocument to throw on non-ready states and remove polling logic from usePdfDocument, shifting readiness detection to event streams. Switch API responses for non-ready parses from 202 to 409 to clarify client expectations and simplify error handling.

Add targeted tests to verify legacy backfill behavior and ensure no worker operation is created for pure data fetches of pending legacy PDFs.

BREAKING CHANGE: API now returns 409 Conflict for non-ready parsed PDFs instead of 202, and clients must subscribe to event streams for parse progress.
2026-06-04 10:52:49 -06:00
..
[id] feat(pdf): refactor parse operation orchestration and client readiness flow 2026-06-04 10:52:49 -06:00
blob fix(documents): handle precondition failures and optimize upload finalization 2026-06-03 20:50:44 -06:00
docx-to-pdf/upload feat(pdf): refactor parse operation orchestration and client readiness flow 2026-06-04 10:52:49 -06:00
library refactor: roll out phase 7 server error contract 2026-05-27 07:24:07 -06:00
route.ts feat(upload): implement presigned token-based upload with finalize step 2026-06-03 20:14:18 -06:00