Great question! Dates and times are one of the most loathed obstacles in writing software that needs to work a particular way across millions of devices situated all across the globe in different regions and time zones.
In our case, we had a bit of code that aimed to measure the time until midnight/tomorrow. But when clocks change at midnight (jumping forward or backward), you can wind up with days that appear to be longer than 24 hours in length. And when a day is more than ~24hr in length, you wind up with unexpected answers to seemingly simple math equations.
A bit of logic, responsible for setting up a timer, wound up scheduling numerous timers when our 'How long until tomorrow' code began returning negative numbers. That set of unintended timers locked-up the application itself. You can see our issue for the behavior here: https://github.com/brave/brave-core/pull/11030.
For 10 minutes of anxiety, check out 'The Problem of Time & Timezones' from Tom Scott of Computerphile: https://youtu.be/-5wpm-gesOY. It's a fantastic summary of the issues programmers face when dealing with time :)
silisili|4 years ago
Is there a link or can you share more? Why would a DST bug prevent an app from opening at all?
jonathansampson|4 years ago
In our case, we had a bit of code that aimed to measure the time until midnight/tomorrow. But when clocks change at midnight (jumping forward or backward), you can wind up with days that appear to be longer than 24 hours in length. And when a day is more than ~24hr in length, you wind up with unexpected answers to seemingly simple math equations.
A bit of logic, responsible for setting up a timer, wound up scheduling numerous timers when our 'How long until tomorrow' code began returning negative numbers. That set of unintended timers locked-up the application itself. You can see our issue for the behavior here: https://github.com/brave/brave-core/pull/11030.
For 10 minutes of anxiety, check out 'The Problem of Time & Timezones' from Tom Scott of Computerphile: https://youtu.be/-5wpm-gesOY. It's a fantastic summary of the issues programmers face when dealing with time :)
Sampson (Brave Team)