Skip to content

Fix #158: bulk publish/delete load + return body-less summaries#166

Merged
mkreyman merged 2 commits into
masterfrom
fix/158-bulk-bodyless
Jun 24, 2026
Merged

Fix #158: bulk publish/delete load + return body-less summaries#166
mkreyman merged 2 commits into
masterfrom
fix/158-bulk-bodyless

Conversation

@mkreyman

Copy link
Copy Markdown
Owner

Summary

Closes #158. bulk_publish and bulk_delete (archive) loaded full %Article{} structs (incl. body, ~500KB each) for up to 5000 ids and rendered the affected set with article_data (full body) — the same payload/memory vector #148a bounded for GET /articles. bulk_unpublish was 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_archive load via load_existing_by_ids(..., false) (body-less). The status transition, audit, and embedding enqueue need only id/statusenqueue_bulk_embeddings uses article.id and the ArticleEmbeddingWorker re-loads the full body itself, so nothing downstream needs the in-memory body.
  • bulk_publish / bulk_delete controllers render ArticleJSON.article_summary (body-less), consistent with bulk_unpublish. Per-id outcomes in meta.results are unchanged.
  • load_existing_by_ids drops its \\ true default (all three callers are now body-less).

Contract change

POST /knowledge/bulk-publish and POST /knowledge/bulk-delete data[] entries no longer include body (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 matches bulk-unpublish and 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 precommit clean.

mkreyman added 2 commits June 23, 2026 20:53
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.
@mkreyman mkreyman merged commit 2e88112 into master Jun 24, 2026
6 checks passed
@mkreyman mkreyman deleted the fix/158-bulk-bodyless branch June 24, 2026 03:42
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.

bulk_publish/bulk_delete load + return full article bodies for up to 5000 rows (payload/memory)

1 participant