commitsto / commits.to

Real-time commitment tracking
http://commits.to
MIT License
40 stars 20 forks source link

Don't allow due dates in the past (was: time parsing error) #239

Open bsoule opened 6 years ago

bsoule commented 6 years ago

On http://bee.commits.to/check-habitica-dailies-thread-w-crystal-before-midnight

The due date was parsed as 1 January 1900.

(is it ok if I correct the due date? or will it be useful for me to leave it for debugging?)

dreeves commented 6 years ago

Here's a snapshot of the row of the database so @bsoule can fix her due date!

bee/check-habitica-dailies-thread-w-crystal-before-midnight |   | check-habitica-dailies-thread-w-crystal-before-midnight | check-habitica-dailies-thread-w-crystal | Check habitica dailies thread w crystal | FALSE | FALSE | 0.005259171042928253 | 2018-07-30 17:02:04.429+00 | 1900-01-01 08:00:00+00 |   | 1 | 3 |   | 2018-07-30 17:02:04.43+00 | 2018-07-30 19:20:01.962+00 | 8 | 76.105.255.250 | "{\"isAuthoritative\":true,\"isChrome\":true,\"isDesktop\":true,\"isMac\":true,\"browser\":\"Chrome\",\"version\":\"67.0.3396.79\",\"os\":\"macOS Sierra\",\"platform\":\"Apple Mac\",\"geoIp\":{},\"source\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.79 Safari/537.36\"}" | America/Los_Angeles

chrisbutler commented 6 years ago

this looks pretty similar to https://github.com/commitsto/commits.to/issues/192, the fix for which was implemented in sherlock itself... hmmm...

dreeves commented 6 years ago

Reproducible on staging:

http://alice.commitsto.review/check-habitica-dailies-thread-w-crystal-before-midnight

dreeves commented 6 years ago

Proposal: Add a special case to say if it parses to more than a year in the past then pretend it didn’t find a date at all. In the status quo that means treating it as if it said "in a week" which is particularly wrong in this case. But if we do #260 then it means the human will have to pick a date, which is a good choice when Sherlock is clearly hopelessly confused.

chrisbutler commented 6 years ago

@dreeves why do we pick a year? isn't any date in the past going to be 'wrong' by this logic?

dreeves commented 6 years ago

I kinda half-imagined use cases where you remember after the fact that you said you'd do something by last week and want to log that. A year is way too much though, now that you mention it. And even for my imagined use case, having to manually adjust the due date in such rare cases totally fine. So, yeah, I agree, no due dates in the past!