Skip to content

Conversation

itslenny
Copy link
Contributor

@itslenny itslenny commented Oct 8, 2025

🔍 Description

Update BlobDownloadBuilder to be fully compatible with the Promise interface to maintain backward compatibility.

What changed?

BlobDownloadBuilder now implements the entire Promise interface so it can be assigned to a Promise variable without TypeScript complaining.

Why was this change needed?

This resolves a breaking type change introduced in storage-js 2.12.2 by this PR: supabase/storage-js#137

Currently, assigning the return of the download() function to a strongly typed variable results in a type error:

Argument of type 'BlobDownloadBuilder' is not assignable to parameter of
type 'Promise<StorageApiResponse<unknown>>'.

Type 'BlobDownloadBuilder' is missing the following properties from
type 'Promise<StorageApiResponse<unknown>>': catch, finally, [Symbol.toStringTag]

Additionally, attempting to use .catch() or .finally() would result in an error as those functions were not defined in BlobDownloadBuilder so anyone depending on them would hit a runtime error.

📸 Screenshots/Examples

Screenshot 2025-10-08 at 2 30 24 PM

@itslenny itslenny requested review from a team as code owners October 8, 2025 18:39
@coveralls
Copy link

Coverage Status

coverage: 95.455% (+13.0%) from 82.5%
when pulling 4f80484 on fix/make-download-return-type-backward-compatible
into 00c4a11 on master.

@itslenny itslenny merged commit 4dcc5a9 into master Oct 9, 2025
21 checks passed
@itslenny itslenny deleted the fix/make-download-return-type-backward-compatible branch October 9, 2025 18:57
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.

3 participants