Repository navigation
ref(api): Read and write Objectstore batches with FormData - #131779
Merged
Merged
Conversation
Objectstore's batch endpoint now has a JSON layout that carries all operation data in form fields (getsentry/objectstore#804). Build batch requests with FormData and read results with Response.formData(), replacing the hand-rolled multipart encoder and parser. Refs getsentry/objectstore#769 Co-Authored-By: BYK <[email protected]>
BYK
marked this pull request as ready for review
November 20, 2026 20:03
BYK
approved these changes
Nov 20, 2026
BYK
left a comment
Member
There was a problem hiding this comment.
Nice! I also got a note here from the authors:
We’re also disabling compression now for PNGs because it doesn’t make sense
And ref: getsentry/sentry-cli#3504
This branch was successfully deployed
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.
The
@sentry/apiObjectstore client (used by the Sentry CLI'ssnapshots upload) had its own byte-level multipart encoder and parser for the batch endpoint, because all per-operation data travelled in custom part headers thatFormDatadrops. Objectstore now has a JSON layout for batches that carries that data in form fields instead (getsentry/objectstore#769, getsentry/objectstore#804, thanks @jan-auer). This switches the client to it:FormData: each operation is a JSON descriptor field named by its index ({"kind":"head","key":"…"}), and each insert also gets a"<i>.payload"file holding the bytes. The expiration policy moves from thex-sn-expirationpart header tometadata.expiration.fetchsets the multipartContent-Typeand boundary.Response.formData(). Each result is a JSON field named by its operation index ({"status":404,…}, witherror.detailon failure). Fields that aren't results, such as GET payloads, are skipped. A multipart response that can't be parsed throws anObjectstoreError(502), the same as a response that isn't multipart.encodeHeaderValue, the boundary regex, and the byte-scanning helpers are removed.The public API (
findExistingObjects,putObjects,ObjectstoreError) doesn't change. Single-objectPUTs for files over 1 MB don't change either. All part names are quoted, so Node 22'sResponse.formData()(undici before 7.17) can parse responses too.Open question before merge: the client no longer speaks the header layout, so it needs an Objectstore server that has getsentry/objectstore#804. A server without it would fail every batch operation. Please confirm that the production Objectstore behind the Sentry proxy runs a build with #804 before this ships in an
@sentry/apirelease.via @BYK.
--
View Session [Sentry]