Repository navigation
fix(knowledge): honor cancellation during PDF extraction - #532
sylvesterkaczmarek wants to merge 6 commits into
Conversation
1265023 to
64c056c
Compare
|
Rebased onto current main and corrected the cancellation regression's stale assertion: the third cancellation check aborts inside PDF extraction, and the catch intentionally performs one final throwIfAborted call to preserve the original reason. Current head is GitHub Verified; TypeScript build:ci and the focused PDF cancellation regression pass, Prettier is clean, and git diff --check passes. Could a maintainer review the current head? |
Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
ed3cc5c to
9f2af70
Compare
|
Note You have reached your Codex usage limits for security reviews. Please try again later. |
|
Refreshed this PR onto current |
|
Resolved the conflict in |
|
Following up on the PDF cancellation fix now that the refreshed head Could a maintainer review this head when convenient? Happy to address any specific feedback. |
|
Thanks for checking the blank-page cleanup case too, Michael. The extra cancellation check after PDF cleanup addresses that gap while leaving ordinary cleanup errors visible. Appreciate you tightening the tests around both entry points. |
Summary
Canceling a scan during PDF page lookup could still start text extraction. If cancellation happened around cleanup, the caller could receive a PDF error or a “no extractable text” error instead of its original abort reason. Fixes #531.
Changes
Check the signal after document and page lookup. Always close the PDF, then honor cancellation whether cleanup succeeds or rejects. When the caller hasn’t canceled, cleanup failures still surface with their original cause.
Testing
mainat28a18608using a controlled PDF loader. The affected cases were cancellation during page lookup, cleanup rejecting after cancellation, and cancellation while successfully closing a blank PDF.Risk and rollout
An in-flight PDF operation still has time to finish and release its resources. This change affects which operation starts next and which error reaches the caller.
Public disclosure review