lau / tzdata

tzdata for Elixir. Born from the Calendar library.
MIT License
298 stars 71 forks source link

[proposal] Split off updater #71

Closed cdegroot closed 5 years ago

cdegroot commented 5 years ago

The discussion about tzdata's unexpected update behaviour came up on Slack again (https://elixir-lang.slack.com/archives/C0AB4A879/p1546084693076000). I think there's a way to have your cake and eat it, too - split off the update logic.

After the split, there'd be two libraries:

That way, downstream libraries like timex can just depend on the tzdata library and nothing unexpected will happen (nor will maintainers of downstream libraries be forced to make a decision on whether this behaviour is wanted or not - they can't, only the end user can). If someone wants the update behaviour, that is simple enough to accomplish by adding the tzdata_updater dependency as well. No messing around with Mix configs needed.

(needless to say, more than happy to chip in some time to make this happen)

lau commented 5 years ago

I cannot see the discussion you linked to because it requires a login.

The update behaviour is explained in the readme https://github.com/lau/tzdata#automatic-data-updates It is very easy to change the setting using the config setting config :tzdata, :autoupdate, :disabled

lau commented 5 years ago

For people that do not bother to read the readme of the libraries the use, I believe that auto updating is the best default. For most people including those that care to read the readmes of the libraries they use, they can choose to disable the auto updating and instead keep up with new tzdata versions every single day and make sure to update to new versions within 24 hours manually.

cdegroot commented 5 years ago

The problem is that most users aren’t aware that this library is in their dependency path (they use timex). It conflates two functions and the default is in many circumstances unwanted. But I can’t apparently sway the maintainer so I’ll likely fork it to a by-default non updating version.

Sent from my iPhone

On Dec 29, 2018, at 16:00, Lau Taarnskov notifications@github.com wrote:

For people that do not bother to read the readme of the libraries the use, I believe that auto updating is the best default. For most people including those that care to read the readmes of the libraries they use, they can choose to disable the auto updating and instead keep up with new tzdata versions every single day and make sure to update to new versions within 24 hours manually.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.