Fix #158: bulk publish/delete load + return body-less summaries#166
Merged
Conversation
bulk_publish and bulk_delete (archive) loaded full %Article{} structs
(including body, which can be ~500KB) for up to 5000 ids and rendered the
affected set with ArticleJSON.article_data (full body) — the same
payload/memory vector #148a bounded for GET /articles. bulk_unpublish was
already hardened to body-less in #148c; this brings its two siblings into line.
- do_bulk_publish / do_bulk_archive now load via load_existing_by_ids(..., false)
— the status transition, audit, and embedding enqueue need only id/status
(enqueue uses article.id; the embedding worker re-loads the full body itself),
so no body is materialized.
- bulk_publish / bulk_delete controllers render ArticleJSON.article_summary
(body-less), consistent with bulk_unpublish. The actionable per-id detail is
meta.results; data is body-less confirmation.
- load_existing_by_ids drops its `\\ true` default (every caller is now body-less;
pass true explicitly if a future caller needs bodies).
Contract note: bulk-publish / bulk-delete `data[]` no longer includes `body`
(per-id outcomes in `meta.results` are unchanged). Tests assert the body-less
shape for both, mirroring the existing bulk-unpublish assertion.
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.
Summary
Closes #158.
bulk_publishandbulk_delete(archive) loaded full%Article{}structs (incl.body, ~500KB each) for up to 5000 ids and rendered the affected set witharticle_data(full body) — the same payload/memory vector #148a bounded forGET /articles.bulk_unpublishwas hardened to body-less in #148c; this brings its two siblings into line so all three bulk ops behave identically.Change
do_bulk_publish/do_bulk_archiveload viaload_existing_by_ids(..., false)(body-less). The status transition, audit, and embedding enqueue need onlyid/status—enqueue_bulk_embeddingsusesarticle.idand theArticleEmbeddingWorkerre-loads the full body itself, so nothing downstream needs the in-memory body.bulk_publish/bulk_deletecontrollers renderArticleJSON.article_summary(body-less), consistent withbulk_unpublish. Per-id outcomes inmeta.resultsare unchanged.load_existing_by_idsdrops its\\ truedefault (all three callers are now body-less).Contract change
POST /knowledge/bulk-publishandPOST /knowledge/bulk-deletedata[]entries no longer includebody(they were full articles; now body-less summaries —id,title,category,status,tags, source/idempotency fields,metadata, timestamps).meta.results(the actionable per-id breakdown) is unchanged. This matchesbulk-unpublishand the #148a body-less-by-default direction.Tests
Added body-less assertions to both the bulk-publish and bulk-delete tests (mirroring the existing bulk-unpublish assertion). Full suite green (2500),
mix precommitclean.