Skip to content

docs(documents): record that deleting an artifact document removes its files - #2015

Merged
MODSetter merged 1 commit into
devfrom
docs/documents-artifact-delete-twin
Sep 28, 2026
Merged

MODSetter merged 1 commit into
devfrom
docs/documents-artifact-delete-twin

Conversation

@MODSetter

@MODSetter MODSetter commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

What

Finishes the doc side of #1934 in docs/architecture/documents.md:

  • Deletes the Known gaps line saying that deleting an ARTIFACT document leaves its files under artifacts/<id>/.
  • Corrects the prose bullet in Retry, cancel and delete, which still said delete "removes only documents/<id>/, so the artifact's files under artifacts/<id>/ stay on disk".

Why

The same gap was written down in two docs. #1934 fixed the code and deleted the line in docs/architecture/studio.md, but documents.md carried its own copy and kept it, along with a prose sentence asserting the old behaviour. Both are now false on dev.

delete_document() in surfsense_local/backend/modules/documents/router.py builds a list of directories and appends storage.artifact_dir(...) when document.artifact is not None, then removes each after the commit:

directories = [storage.document_dir(document.workspace_id, document.id)]
# A Studio output keeps its rendered blobs under its artifact's own id.
if document.artifact is not None:
    directories.append(
        storage.artifact_dir(document.workspace_id, document.artifact.id)
    )

studio.md needs nothing further: its remaining sentence about DELETE /artifacts/{id} was always about the artifact route and is still accurate.

This is worth catching rather than leaving: CONTRIBUTING.md and the READMEs send contributors to the Known gaps lists to find work, so the surviving line advertises a fixed bug as an open task. It was deliberately not filed as an issue in the recent batch precisely because #1934 was expected to close it.

Fixes #

How to test

python scripts/check_docs.py

96 doc files, 0 problems. Docs only, no code touched. The behaviour the new wording describes is covered by the integration test #1934 added in surfsense_local/backend/tests/integration/artifacts/test_routes.py.

High-level PR Summary

This PR updates the documentation in documents.md to accurately reflect that deleting an ARTIFACT document now removes both the document files under documents/<id>/ and the artifact files under artifacts/<id>/. The changes remove an outdated Known gaps entry and correct a prose description that still claimed the old behavior where artifact files would remain on disk after deletion. These documentation updates align with the code changes from PR #1934 that fixed this behavior.

⏱️ Estimated Review Time: 5-15 minutes

💡 Review Order Suggestion
Order File Path
1 docs/architecture/documents.md

Need help? Join our Discord

…s files

PR #1934 fixed the code and deleted the Known gap line in studio.md, but documents.md carried the same gap plus a prose bullet asserting the old behaviour. Both were false on dev.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
surf-sense-frontend Ready Ready Preview Sep 28, 2026 11:09pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 28, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 6c4259c7-6b73-427a-9aff-6aca0aaf9abf

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@MODSetter
MODSetter merged commit a328cb9 into dev Sep 28, 2026
18 of 19 checks passed

This branch was successfully deployed

1 active deployment
Preview — c2ef0ed6 Deployed Sep 28, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant