chore(deps): replace tzdata with tz to drop hackney - #189
Merged
Merged
Conversation
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.
Summary
Replaces
tzdatawithtzas Flick's timezone database. This removeshackneyfrom the dependency tree entirely —tzdatawas its only non-optional dependent — which clears the four openhackney1.25.0 advisories thatmix hex.auditflagged (CVE-2026-47069/47071/47075/47076).mix hex.auditnow reports no advisories at all.tzcompiles the IANA timezone data into the build at compile time, so there is no runtime HTTP client and no data-download-to-disk. It is the correctness-focused, actively maintained alternative that Elixir's ownDateTimedocs link to. Its one tradeoff versustzdata— new IANA releases require a recompile/redeploy rather than a live download — is a non-issue for a web app that redeploys regularly, and arguably a plus (deterministic data, no writable data dir).Changes
mix.exs:{:tzdata, "~> 1.1"}→{:tz, "~> 0.28"}config/config.exs:config :elixir, :time_zone_database, Tzdata.TimeZoneDatabase→Tz.TimeZoneDatabasemix.lock: dropstzdata,hackney, and hackney's exclusive deps (certifi,metrics,mimerl,parse_trans,ssl_verify_fun); addstzNo application code changed.
Flick.DateTimeFormatterusesDateTime.shift_zone/2andCalendar.strftime/2, which read whatever:time_zone_databaseis configured, so the backend swap is transparent to them.Verification
mix precommitpasses (108 tests, Credo clean)mix hex.auditreports no retired or security-advisory packagesDateTime.shift_zone/2resolvesAmerica/New_York(EDT) andAustralia/Sydney(AEST) correctly, and returns{:error, :time_zone_not_found}for an unknown zone, withCalendar.get_time_zone_database/0reportingTz.TimeZoneDatabaseNote
tzhas an optionalTz.UpdatePeriodicallysupervisor for live IANA updates, which usesmint(not hackney). It is not wired up here — we take timezone data at compile time and refresh it on redeploy.