-
Notifications
You must be signed in to change notification settings - Fork 3.3k
fix(supabase): storage upload + add basic mode version #2996
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile OverviewGreptile SummaryThis PR refactors the Supabase storage upload functionality to support both basic and advanced modes. The main changes include:
The implementation follows established patterns for file handling and includes comprehensive logging throughout the upload flow. Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant UI as Supabase Block UI
participant Tool as storage_upload.ts
participant API as /api/tools/supabase/storage-upload
participant FileUtils as File Utils
participant Supabase as Supabase Storage
User->>UI: Select mode (basic/advanced)
alt Basic Mode
User->>UI: Upload file via file-upload field
UI->>Tool: fileData = UserFile object
else Advanced Mode
User->>UI: Enter content in code field
UI->>Tool: fileData = string (base64/text)
end
Tool->>API: POST /api/tools/supabase/storage-upload
API->>API: checkInternalAuth()
API->>API: validate with SupabaseStorageUploadSchema
alt fileData is string
API->>API: Check for data URL pattern
API->>API: Detect if base64 or plain text
API->>API: Convert to Buffer
else fileData is object (UserFile)
API->>FileUtils: processSingleFileToUserFile()
FileUtils-->>API: userFile
API->>FileUtils: downloadFileFromStorage()
FileUtils-->>API: Buffer
end
API->>API: Construct fullPath with folder
API->>Supabase: POST /storage/v1/object/{bucket}/{path}
Supabase-->>API: Upload response
API->>API: Generate publicUrl
API-->>Tool: {success, output: {message, results}}
Tool-->>UI: Display results
UI-->>User: Show upload success
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 file reviewed, 1 comment
|
@cursor review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
|
@cursor review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Summary
Supabase storage upload updates. Remove dead workspaces route.
Type of Change
Testing
Tested with @Sg312
Checklist