Skip to content

Fix Supabase storage driver file uploads and improve error handling#25883

Merged
ComfortablyCoding merged 12 commits intomainfrom
gaetan/cms-1347-supabase-storage-driver-stat-method-breaks-file-uploads
Sep 26, 2025
Merged

Fix Supabase storage driver file uploads and improve error handling#25883
ComfortablyCoding merged 12 commits intomainfrom
gaetan/cms-1347-supabase-storage-driver-stat-method-breaks-file-uploads

Conversation

@gaetansenn
Copy link
Contributor

@gaetansenn gaetansenn commented Sep 23, 2025

Scope

What's changed:

  • Upgraded @supabase/storage-js from 2.10.4 to 2.12.1 to fix Node.js duplex option compatibility issues
  • Added proper error handling in DriverSupabase.write() method to catch and throw upload failures

Potential Risks / Drawbacks

  • Upload errors that were previously silent will now throw exceptions
  • New Supabase storage library version may introduce unforeseen compatibility issues

Tested Scenarios

  • File upload with valid Supabase configuration - uploads succeed and filename_disk is properly populated
  • File upload without duplex: 'half' throws an error during upload and has been caught before the stat call function.

Review Notes / Questions

  • I would like to verify that the new Supabase library version doesn't break any existing functionality in production environments
  • Special attention should be paid to dolor sit amet

Checklist

  • Added or updated tests
  • Documentation PR created here or not required

Fixes #25871

@linear
Copy link

linear bot commented Sep 23, 2025

@gaetansenn gaetansenn self-assigned this Sep 23, 2025
Copy link
Member

@ComfortablyCoding ComfortablyCoding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments but overall LGTM 🚀

Tested
  • Expect uploads to work
  • Expect create/update/delete to work
  • Expect TUS to work with CRUD

@ComfortablyCoding ComfortablyCoding changed the title Gaetan/cms 1347 supabase storage driver stat method breaks file uploads Fix Supabase storage driver file uploads and improved error handling Sep 26, 2025
@ComfortablyCoding ComfortablyCoding changed the title Fix Supabase storage driver file uploads and improved error handling Fix Supabase storage driver file uploads and improve error handling Sep 26, 2025
@ComfortablyCoding ComfortablyCoding merged commit e188b69 into main Sep 26, 2025
66 checks passed
@ComfortablyCoding ComfortablyCoding deleted the gaetan/cms-1347-supabase-storage-driver-stat-method-breaks-file-uploads branch September 26, 2025 20:28
@github-actions github-actions bot added this to the Next Release milestone Sep 26, 2025
u12206050 pushed a commit to u12206050/directus that referenced this pull request Oct 22, 2025
…irectus#25883)

* build: upgrade supabase/storage-js to avoid duplex upload error

* fix(storage-driver-supabase): throw error on failed write

* feat: add changeset

* fix: fix changeset message

* fix: fix linter

* fix: fix typescript requirement for Required<DriverSupabaseConfig>

* fix: update upload method from bucket and add new tests

* fix: handle feedbacks

* fix: fix test

* braces

* fmt

---------

Co-authored-by: daedalus <[email protected]>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Supabase storage driver stat() method breaks file uploads - filename_disk remains null

2 participants