fix(storage): make StreamDownloadBuilder implement Promise and memoize executor#2367
Merged
mandarini merged 1 commit intoMay 18, 2026
Conversation
…e executor StreamDownloadBuilder declared PromiseLike instead of Promise, so it lacked catch, finally, and [Symbol.toStringTag]. Its then also ran execute() on every call, which meant each await re-issued the underlying fetch. Rewrites the class to mirror BlobDownloadBuilder: implements Promise<DownloadResult<ReadableStream>>, caches the in-flight promise in a private getPromise(), and adds catch, finally, and Symbol.toStringTag. The constructor signature, exports, and execute() body are unchanged. Added test/downloadBuilders.test.ts covering five behaviors on the stream builder (single executor call across multiple awaits, .catch(), .finally(), Symbol.toStringTag, Promise assignability), plus two regression checks on BlobDownloadBuilder.
@supabase/auth-js
@supabase/functions-js
@supabase/postgrest-js
@supabase/realtime-js
@supabase/storage-js
@supabase/supabase-js
commit: |
This was referenced May 18, 2026
mandarini
pushed a commit
to supabase/ssr
that referenced
this pull request
May 18, 2026
This PR updates `@supabase/supabase-js` to v2.106.0. **Source**: supabase-js-stable-release --- ## Release Notes ## v2.106.0 ## 2.106.0 (2026-05-18) ### 🚀 Features - **supabase:** W3C/OpenTelemetry trace context propagation ([#2163](supabase/supabase-js#2163)) ### 🩹 Fixes - **auth:** return null user and session for email_change single-confirmation verifyOtp ([#2378](supabase/supabase-js#2378)) - **release:** mark @supabase/tracing private and snapshot it for JSR ([#2370](supabase/supabase-js#2370)) - **storage:** make StreamDownloadBuilder implement Promise and memoize executor ([#2367](supabase/supabase-js#2367)) ### ❤️ Thank You - Claude Sonnet 4.5 - Guilherme Souza - Katerina Skroumpelou @mandarini - oniani1 This PR was created automatically. Co-authored-by: supabase-workflow-trigger[bot] <266661614+supabase-workflow-trigger[bot]@users.noreply.github.com>
mandarini
pushed a commit
to supabase/supabase
that referenced
this pull request
May 19, 2026
This PR updates @supabase/*-js libraries to version 2.106.0. **Source**: supabase-js-stable-release **Changes**: - Updated @supabase/supabase-js to 2.106.0 - Updated @supabase/auth-js to 2.106.0 - Updated @supabase/realtime-js to 2.106.0 - Updated @supabase/postgest-js to 2.106.0 - Refreshed pnpm-lock.yaml --- ## Release Notes ## v2.106.0 ## 2.106.0 (2026-05-18) ### 🚀 Features - **supabase:** W3C/OpenTelemetry trace context propagation ([#2163](supabase/supabase-js#2163)) ### 🩹 Fixes - **auth:** return null user and session for email_change single-confirmation verifyOtp ([#2378](supabase/supabase-js#2378)) - **release:** mark @supabase/tracing private and snapshot it for JSR ([#2370](supabase/supabase-js#2370)) - **storage:** make StreamDownloadBuilder implement Promise and memoize executor ([#2367](supabase/supabase-js#2367)) ### ❤️ Thank You - Claude Sonnet 4.5 - Guilherme Souza - Katerina Skroumpelou @mandarini - oniani1 This PR was created automatically. Co-authored-by: supabase-workflow-trigger[bot] <266661614+supabase-workflow-trigger[bot]@users.noreply.github.com>
This was referenced May 19, 2026
This was referenced Jun 2, 2026
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.
Closes #2366.
Summary
StreamDownloadBuilderdeclaredPromiseLikeinstead ofPromise, so it lackedcatch,finally, and[Symbol.toStringTag]. Itsthenalso ranexecute()on every call, which meant eachawaitre-issued the underlying fetch.This change rewrites the class to mirror the sibling
BlobDownloadBuilder: it now implementsPromise<DownloadResult<ReadableStream>>, caches the in-flight promise in a privategetPromise(), and adds the missingcatch,finally, andSymbol.toStringTagmembers. The constructor signature, exports, andexecute()body are unchanged.Test plan
Added
test/downloadBuilders.test.tscovering five behaviors on the stream builder (single executor call across multiple awaits,.catch(),.finally(),Symbol.toStringTag,Promiseassignability), plus two regression checks onBlobDownloadBuilder. All seven pass.