Skip to content

Correct pattern matching in do_latest_file_size_by_head - #191

Merged
lau merged 3 commits into
masterfrom
fix-size-head
Sep 26, 2026
Merged

lau merged 3 commits into
masterfrom
fix-size-head

Conversation

@lau

@lau lau commented Sep 25, 2026

Copy link
Copy Markdown
Owner

Alternate PR to #162 because of git conflicts

Fix where pattern matching expected a flat
3-tuple {tag, status, headers} but HTTPClient behaviour returns nested structure {:ok, {status, headers}}.

This causes a FunctionClauseError when calling
latest_file_size_by_head, silently falling back to GET requests.

Adds sham to allow for testing

mattwynne and others added 2 commits September 20, 2026 23:17
Fix where pattern matching expected a flat
3-tuple {tag, status, headers} but HTTPClient behaviour
returns nested structure {:ok, {status, headers}}.

This causes a FunctionClauseError when calling
latest_file_size_by_head, silently falling back to GET requests.

Adds sham to allow for testing

Co-authored-by: Ryan Spore <ryan@mechanical-orchard.com>
@lau
lau marked this pull request as draft September 25, 2026 16:09
Plug's Plug.Upload.Supervisor unconditionally uses PartitionSupervisor,
which was added in Elixir 1.13. That breaks the "Older elixir" CI job
(Elixir 1.12.3), where starting the :plug application during `mix test`
raises ArgumentError. Only depend on sham/bandit, and only compile the
tests that use them, when the running Elixir supports PartitionSupervisor.
@lau
lau marked this pull request as ready for review September 25, 2026 16:22
@lau
lau merged commit 062cc7e into master Sep 26, 2026
2 checks passed
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.

2 participants