Comment on Windows feature that resets system clocks based on random data is wreaking havoc

<- View Parent
Z4rK@lemmy.world ⁨1⁩ ⁨year⁩ ago

While the root issue was still unknown, we actually wrote one. It sort of made sense. Check that the date from isn’t later than date to in the generated range used for the synchronization request. Obviously.

However, it was far worse to write the code that fulfilled the test. In the very same free lines of code, we fetched the current date from time.now() plus some time span as date to, fetched the last synchronization timestamp from db as date from, and then validated that date from wasn’t greater than date to, and if so, log an error about it.

The validation code made no logic sense when looking at it.

source
Sort:hotnewtop