Skip to content

A document pushed as JSON has a version, so its original can be read back - #1211

Merged
WaylandYang merged 1 commit into
devfrom
fix/a-pushed-original-has-a-version
Oct 13, 2026
Merged

WaylandYang merged 1 commit into
devfrom
fix/a-pushed-original-has-a-version

Conversation

@WaylandYang

Copy link
Copy Markdown
Contributor

Why

#1204 gave multipart uploads their first version row. The JSON push (POST /kbs/{id}/ingest) creates its document through documents::create, which still wrote none, so GET /documents/{id}/content answered 500 for every pushed document. Seen on a local dev server: one push, content 500, zero version rows.

What changes

documents::create writes the document and version 1 in one transaction. Nothing else moves: the restore of a soft-deleted original and the queueing in ingest_upload are as before. Documents pushed before this are repaired by migration 0111, which has not been released yet.

Test

a_pushed_document_serves_its_original: push through ingest_upload, one version row, the content route returns the bytes. Without the change it fails on the version count (0 for 1). cargo test -p utopia-store and the document route tests pass on a fresh database; clippy is clean.

🤖 Generated with Claude Code

…back

#1204 gave multipart uploads their first version row. The JSON push
(POST /kbs/{id}/ingest) creates its document through documents::create,
which still wrote none, so GET /documents/{id}/content answered 500 for
every pushed document. The document and version 1 are now written in one
transaction there too. Documents pushed before this are repaired by
migration 0111.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Wayland Yang <wayland0916@gmail.com>
@WaylandYang
WaylandYang merged commit 259931a into dev Oct 13, 2026
6 checks passed
@WaylandYang
WaylandYang deleted the fix/a-pushed-original-has-a-version branch October 13, 2026 02:17
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