The supabase_potion library returns a %Finch.Response{} struct, which broke the pattern matching inside the create_signed_url/4 function, causing issues with correctly extracting the expected data.
Solution
I updated the supabase_potion dependency in mix.exs to the latest version. Then, I modified the Fetcher call by adding the resolve_json: true option, which ensures that the response is automatically parsed as JSON, allowing the pattern matching to work as intended.
Rationale
This approach was chosen to maintain consistency with the way responses are handled across the codebase, ensuring that JSON parsing is performed centrally and pattern matching can be used effectively. Updating the library also keeps the project aligned with the latest fixes and improvements.
Problem
The
supabase_potion
library returns a%Finch.Response{}
struct, which broke the pattern matching inside thecreate_signed_url/4
function, causing issues with correctly extracting the expected data.Solution
I updated the
supabase_potion
dependency inmix.exs
to the latest version. Then, I modified the Fetcher call by adding theresolve_json: true
option, which ensures that the response is automatically parsed as JSON, allowing the pattern matching to work as intended.Rationale
This approach was chosen to maintain consistency with the way responses are handled across the codebase, ensuring that JSON parsing is performed centrally and pattern matching can be used effectively. Updating the library also keeps the project aligned with the latest fixes and improvements.