Hacker News new | ask | show | jobs
by petemill 1655 days ago
Brave team member here. This was not a server issue but was a daylight savings time bug.
1 comments

Thank you Pete.

Is there a link or can you share more? Why would a DST bug prevent an app from opening at all?

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 :)

Sampson (Brave Team)

Thank you Sampson.

I apologize for my hasty comments. Based on the Reddit thread I had seen, it seemed most people were blaming a down server - and to a user, that's what it -felt- like too, seeing as there wasn't an app update or anything recent. I'm thrilled to hear that wasn't the case, and appreciate the explanation. Sounds like we're staying with Brave then!

It's alarming how cavalier people are with spreading made-up explanations when something isn't working as expected. But we're always here and happy to chat about what's actually happening (provided there is indeed an issue, and we have it understood). Thank you for allowing us a moment to share more information; I hope the DST topic and aforementioned video on Time and Timezones wasn't too frightening, lol :)

Sampson (Brave Team)