mirror of
https://github.com/supabase/supabase.git
synced 2026-10-08 19:05:06 +03:00
This pull request introduces improvements to the handling of storage endpoints in the Studio app, ensuring that storage operations utilize the correct endpoint and enhancing maintainability through import path updates and code clarity. The most significant changes are grouped below: **Storage Endpoint Handling:** * The `useProjectEndpointQuery` hook now returns both `clientEndpoint` and `storageEndpoint`, allowing storage operations to use a dedicated endpoint when available. * In the `StorageExplorerStateContextProvider`, the logic for constructing the resumable upload URL now prefers `storageEndpoint` if present, falling back to `clientEndpoint` otherwise. This ensures uploads use the most appropriate endpoint. * The context provider now sets `clientEndpoint` to `storageEndpoint` when available, further aligning storage requests with the correct endpoint. * The dependency array for the provider effect now includes `storageEndpoint`, ensuring state updates when the storage endpoint changes. **Code Quality and Maintainability:** * Import paths in `storage-explorer.tsx` have been updated to use alias (`@/`) references, improving clarity and maintainability. Type-only imports are also used where appropriate, reducing bundle size and potential circular dependencies. **Code Clarity:** * Added comments to chunk size calculations in the upload logic, clarifying the rationale behind chunk sizing for different file sizes.