Skip to content

Conversation

@grdsdev
Copy link
Contributor

@grdsdev grdsdev commented Dec 11, 2025

Description

This PR implements URL transformation for the storage client to use the dedicated storage host, which disables request buffering and allows uploads up to 500GB (previously limited to ~50GB).

Context

This change matches the implementation in storage-js PR #230 and addresses Linear issue SDK-230.

The storage library was previously initialized using the same host as all other Supabase APIs (project-ref.supabase.co/storage/v1), which has limitations for large file uploads. This change automatically transforms legacy URLs to use the dedicated storage infrastructure (project-ref.storage.supabase.co/v1).

Changes

  • Added _transformStorageUrl() static method in SupabaseStorageClient to transform legacy storage URLs
  • Legacy format: project-ref.supabase.co/storage/v1 → New format: project-ref.storage.supabase.co/v1
  • Only transforms Supabase platform hosts (supabase.co, supabase.in, supabase.red)
  • Preserves non-platform hosts and localhost URLs unchanged
  • Added comprehensive test coverage for URL transformation scenarios

Testing

  • All existing tests pass
  • Added 6 new test cases covering:
    • Legacy prod host transformation (supabase.co)
    • Legacy staging host transformation (supabase.red)
    • Legacy India host transformation (supabase.in)
    • New host format acceptance (no modification)
    • Non-platform host preservation
    • Localhost URL preservation

Breaking Changes

None - this is a backward-compatible change that automatically transforms legacy URLs.

Related

…ows >50GB uploads)

Transform legacy storage URLs to use the dedicated storage host which
disables request buffering and allows uploads up to 500GB.

Changes:
- Added _transformStorageUrl() method to transform legacy URLs
- Legacy format: project-ref.supabase.co/storage/v1
- New format: project-ref.storage.supabase.co/v1
- Only transforms Supabase platform hosts (supabase.co, supabase.in, supabase.red)
- Preserves non-platform hosts and localhost URLs unchanged
- Added comprehensive tests for URL transformation scenarios

This matches the implementation in storage-js PR #230 and enables
large file uploads (>50GB) by using the dedicated storage infrastructure.

Closes SDK-230
@grdsdev grdsdev force-pushed the guilherme/sdk-230-supabase-flutter-use-dedicated-storage-host-for-storage-lib branch from 2d75efa to d8190c9 Compare December 11, 2025 22:02
@grdsdev grdsdev requested review from a team and Vinzent03 December 11, 2025 22:03
@coveralls
Copy link

Pull Request Test Coverage Report for Build 20148842269

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 11 of 11 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.05%) to 79.929%

Totals Coverage Status
Change from base Build 20143869923: 0.05%
Covered Lines: 3361
Relevant Lines: 4205

💛 - Coveralls

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.

4 participants