Repository navigation
A document pushed as JSON has a version, so its original can be read back - #1211
Merged
Merged
Conversation
…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>
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.
Why
#1204 gave multipart uploads their first version row. The JSON push (
POST /kbs/{id}/ingest) creates its document throughdocuments::create, which still wrote none, soGET /documents/{id}/contentanswered 500 for every pushed document. Seen on a localdevserver: one push, content 500, zero version rows.What changes
documents::createwrites the document and version 1 in one transaction. Nothing else moves: the restore of a soft-deleted original and the queueing iningest_uploadare 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 throughingest_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-storeand the document route tests pass on a fresh database; clippy is clean.🤖 Generated with Claude Code