Skip to content

feat: replace pipeline-based reads and writes with buffer operations - #649

Merged
trygve-lie merged 1 commit into
mainfrom
feat/stream-redesign
Aug 25, 2026
Merged

feat: replace pipeline-based reads and writes with buffer operations#649
trygve-lie merged 1 commit into
mainfrom
feat/stream-redesign

Conversation

@trygve-lie

Copy link
Copy Markdown
Contributor

Eliminates pipeline() calls from the upload and metadata read/write path:

  • writeJSON() uses sink.writeBuffer() directly — no Readable, no pipeline
  • readJSON() uses sink.readBuffer() directly — no stream collector, no pipeline
  • _persistFile() buffers tar entry chunks with for-await and calls sink.writeBuffer() — no integrityStream Transform, no pipeline to GCS

ssri.fromData() computes the integrity hash directly from the Buffer.

The drainPending concurrency limit (MAX_CONCURRENT_WRITES) is preserved to maintain backpressure on tar extraction. Only pipeline(busboy, tarParser) remains, which is safe as both streams are fresh per-request.

Also adds writeBuffer() and readBuffer() to the internal SinkTest class used in core's test suite.

writeJSON and readJSON now use sink.writeBuffer() and sink.readBuffer()
respectively, eliminating all pipeline() and stream infrastructure from
metadata writes and reads. _persistFile buffers tar entry chunks with
for-await and uses sink.writeBuffer(), replacing pipeline(entry,
integrityStream, writer). ssri.fromData() replaces the integrityStream
Transform. The drainPending concurrency limit is preserved for
backpressure on tar extraction.
@trygve-lie
trygve-lie merged commit ace642f into main Aug 25, 2026
6 checks passed
@trygve-lie
trygve-lie deleted the feat/stream-redesign branch August 25, 2026 10:33
github-actions Bot pushed a commit that referenced this pull request Aug 25, 2026
# [2.4.0](v2.3.0...v2.4.0) (2026-08-25)

### Features

* replace pipeline-based reads and writes with buffer operations ([#649](#649)) ([ace642f](ace642f))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant