Skip to content
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

refactor: match with new supabase_potion release #3

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

zoedsoupe
Copy link
Collaborator

@zoedsoupe zoedsoupe commented Jan 14, 2025

Problem

The project lacked a consistent approach for managing bucket and object operations within Supabase Storage. There were inefficiencies in handling requests, and certain functions required clearer implementations to align with the existing Supabase standards.

Solution

  1. Refactored Bucket Operations:

    • Improved the create_bucket, retrieve_bucket_info, and update_bucket methods to streamline their workflows.
    • Enhanced error handling by introducing clear cases for validation and exception management.
  2. Object Management Improvements:

    • Refactored upload_object, remove_object, and list_objects for better performance and clearer logic.
    • Introduced lazy streaming for large object downloads to handle memory-efficient operations.
  3. Improved Code Maintainability:

    • Consolidated duplicate logic within bucket_handler.ex and object_handler.ex.
    • Updated the usage of request builders with consistent patterns across all modules.

Rationale

The changes were implemented to:

  1. Align the module's operations with Supabase's evolving API standards.
  2. Improve the performance of common storage tasks like bucket creation and object retrieval.
  3. Ensure easier maintainability by removing redundancies and unifying patterns in request handling.
  4. Introduce robust error handling and validations for smoother user interactions and debugging.

@zoedsoupe zoedsoupe force-pushed the feat/follow-supabase-ex-refactor branch from 3063e26 to f83dd1a Compare January 14, 2025 19:36
@zoedsoupe zoedsoupe force-pushed the feat/follow-supabase-ex-refactor branch from f83dd1a to c22977f Compare January 14, 2025 19:37
@zoedsoupe zoedsoupe linked an issue Jan 15, 2025 that may be closed by this pull request
@zoedsoupe zoedsoupe merged commit 90ad694 into main Jan 16, 2025
1 check passed
@zoedsoupe zoedsoupe deleted the feat/follow-supabase-ex-refactor branch January 16, 2025 01:47
zoedsoupe added a commit that referenced this pull request Jan 16, 2025
…ctor

* 'main' of github.com:zoedsoupe/storage-ex:
  refactor: match with new supabase_potion release (#3)
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.

Invalid Unicode Upload from Liveview Upload?
1 participant