Skip to content

Leave unknown names out of fetch_icons instead of raising - #1

Merged
dannote merged 1 commit into
masterfrom
fix/unknown-icon-names
Oct 1, 2026
Merged

dannote merged 1 commit into
masterfrom
fix/unknown-icon-names

Conversation

@dannote

@dannote dannote commented Oct 1, 2026

Copy link
Copy Markdown
Member

Iconify.Fetcher.fetch_icons/2 called Set.get!/2 for every requested name, so asking for an icon the set doesn't have raised. fetch_icon/2 delegates to it, so it raised too, instead of returning {:error, :not_found} as documented. phoenix_iconify's end-to-end test for elixir-volt/phoenix_iconify#2 caught this. fetch_icons/2 now returns only the icons the set has.

This also gets master ready to publish:

  • it depends on the published json_codec ~> 0.3 instead of path: "../json_codec", which came in with the unreleased JSONCodec parsing commits;
  • it drops json_codec's deprecated fast_path: option, which failed --warnings-as-errors.

Tests

End-to-end tests against the Iconify API live in test/e2e/. They're tagged :e2e, excluded from mix test, and run with mix test.e2e:

  • fetch_icons/2 leaves out an unknown name;
  • fetch_icon/2 fetches lucide:layer-arrow-up and reports an unknown name as not found.

mix ci passes (34 tests), and mix test.e2e passes (2 tests).

fetch_icons/2 called Set.get! for every requested name, so fetch_icon/2
raised for an unknown icon instead of returning {:error, :not_found}.
Also depend on the published json_codec 0.3 instead of a local path and
drop its deprecated fast_path option. E2E tests against the Iconify API
run with mix test.e2e.
@dannote
dannote merged commit b2c8fe0 into master Oct 1, 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.

1 participant