Skip to content

fix(storage): guard against empty transform routing through render endpoint - #1551

Merged
spydon merged 2 commits into
mainfrom
worktree-SDK-878
Jul 9, 2026
Merged

spydon merged 2 commits into
mainfrom
worktree-SDK-878

Conversation

@spydon

@spydon spydon commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

An empty or default TransformOptions() was routing download() and getPublicUrl() through the /render/image/ endpoint unnecessarily. Previously the decision was based on transform != null, so any TransformOptions instance, even one with all-null fields, switched to the render path. Now routing only switches to the render endpoint when the transform options actually produce query parameters.

Outcome: implemented (bug fix)

Behavior

  • download(path) without transform uses /object/ endpoint
  • download(path, transform: TransformOptions()) with empty transform uses /object/ endpoint
  • download(path, transform: TransformOptions(width: 200)) uses /render/image/authenticated/ endpoint
  • Same logic for getPublicUrl()

Tests

Added unit tests in packages/storage_client/test/basic_test.dart covering empty vs actual transform routing for both download() and getPublicUrl(). All storage_client unit tests pass.

Reference

Compliance matrix

storage.file_buckets.download_with_transform and storage.file_buckets.get_public_url remain implemented; this fix brings their routing behavior in line with supabase-js, so no status change was required.

@spydon
spydon requested a review from a team as a code owner July 8, 2026 11:48
@github-actions github-actions Bot added the storage This issue or pull request is related to storage label Jul 8, 2026
@spydon
spydon merged commit 3f3e6f6 into main Jul 9, 2026
27 checks passed
@spydon
spydon deleted the worktree-SDK-878 branch July 9, 2026 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

storage This issue or pull request is related to storage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants