Skip to content

fix: improve test suite, cautght bunch of errors - #38

Merged
zoedsoupe merged 2 commits into
mainfrom
fix/file-list
Aug 27, 2026
Merged

zoedsoupe merged 2 commits into
mainfrom
fix/file-list

Conversation

@zoedsoupe

Copy link
Copy Markdown
Member

Problem

Supabase.Storage.File had no test coverage, and writing the tests surfaced three bugs:

Solution

  • Parse :sort_by exclusively via cast_embed/3 under the correct field name.
  • Encode object path segments with URI.encode/1 in Endpoints (the single point where paths enter request URIs) and in get_public_url/3, which builds its URL directly.
  • Set type: :string on the bucket association foreign key.
  • Also fixed get_public_url/3 emitting a trailing ? when no transform query is present.

Rationale

Encoding lives in Endpoints rather than in File's path cleanup so that returned path values 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 of storage_test.exs, mocking the HTTP adapter callbacks (request/2, upload/3, stream/3).

Closes #36 Closes #37

@zoedsoupe
zoedsoupe merged commit d3de7b9 into main Aug 27, 2026
24 checks passed
@zoedsoupe
zoedsoupe deleted the fix/file-list branch August 27, 2026 12:19
@zoedsoupe zoedsoupe mentioned this pull request Aug 27, 2026
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).
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.

Object paths are not URL encoded, so a name containing a space fails to upload Supabase.Storage.File.list/3 raises on every call

1 participant