Repository navigation
fix: improve test suite, cautght bunch of errors - #38
Merged
Merged
Conversation
Merged
zoedsoupe
added a commit
that referenced
this pull request
Aug 27, 2026
🚀 Want to release this? --- ## [0.6.1](v0.6.0...v0.6.1) (2026-08-27) ### Bug Fixes * improve test suite, cautght bunch of errors ([#38](#38)) ([d3de7b9](d3de7b9)) * vector buckets api wire format ([#33](#33)) ([d10e840](d10e840)) ### Miscellaneous Chores * bump upstream lib version ([360f8b9](360f8b9)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Supabase.Storage.Filehad no test coverage, and writing the tests surfaced three bugs:File.list/3raised on every call:SearchOptions.parse/1passed the:sort_byembed throughcast/4and calledcast_embed(:search_by, ...)with a typo, so listing objects never worked (Supabase.Storage.File.list/3 raises on every call #36).bad_request(Object paths are not URL encoded, so a name containing a space fails to upload #37).File.parse/1rejected any object carrying abucket_id, becausebelongs_to(:bucket)defaulted the foreign key to:id(integer) while bucket ids are strings.Solution
:sort_byexclusively viacast_embed/3under the correct field name.URI.encode/1inEndpoints(the single point where paths enter request URIs) and inget_public_url/3, which builds its URL directly.type: :stringon thebucketassociation foreign key.get_public_url/3emitting a trailing?when no transform query is present.Rationale
Encoding lives in
Endpointsrather than inFile's path cleanup so that returnedpathvalues stay unencoded (matching the input the caller gave) while only the wire format is encoded. Segment-wise encoding preserves the/folder structure. Tests follow the existing Mox-based style ofstorage_test.exs, mocking the HTTP adapter callbacks (request/2,upload/3,stream/3).Closes #36 Closes #37