You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Attempting to delete a document with the ingesting or processing status returns 409 Conflict with a message instructing the user to pause it first. However, the request removes existing document files from storage before checking the document status.
The document and its page records remain in the database, and ingestion or processing continues with some of the required files already deleted.
Preconditions
The user is signed in and owns the document.
The document has the ingesting or processing status.
At least one page image has already been generated and saved to storage.
Steps to Reproduce
Upload a multi-page document and start ingestion.
Wait until page images appear in storage.
While the document is still ingesting or processing, attempt to delete it.
Inspect the response to DELETE /api/v1/documents/{id}.
Check the document’s files in storage.
Check the document and page records and observe whether processing continues.
Expected Result
The API returns 409 Conflict with the message:
The document cannot be deleted while it is being ingested or processed. Pause it first.
The rejected deletion request does not remove any document files or database records.
Ingestion or processing continues normally with all required files available.
Actual Result
The API returns 409 Conflict with the expected message.
Existing document files are removed from storage despite the rejected deletion.
The document and page records remain in the database.
Ingestion or processing continues after the existing files have been removed.
Additional Information
This is a regression introduced after the original implementation of #77 — Delete a document.
The original implementation checked document ownership and status before deleting storage files. Commit 8670cf07, merged through PR #226 for TSA-136, moved storage cleanup before these checks.
As a result, files under uploads/{id}/ and pages/{id}/ are deleted before the API rejects the operation.
Description
Attempting to delete a document with the ingesting or processing status returns 409 Conflict with a message instructing the user to pause it first. However, the request removes existing document files from storage before checking the document status.
The document and its page records remain in the database, and ingestion or processing continues with some of the required files already deleted.
Preconditions
Steps to Reproduce
Expected Result
The document cannot be deleted while it is being ingested or processed. Pause it first.
Actual Result
Environment
Severity: High
Priority: Medium
Additional Information
This is a regression introduced after the original implementation of #77 — Delete a document.
The original implementation checked document ownership and status before deleting storage files. Commit 8670cf07, merged through PR #226 for TSA-136, moved storage cleanup before these checks.
As a result, files under uploads/{id}/ and pages/{id}/ are deleted before the API rejects the operation.
Screenshots:
chrome_pTzR76dYWT.mp4