Closed dcastro closed 1 year ago
/cc @YuriRomanowski, let me know what you think.
Counterexamples, on the 14th Feb:
When implementing those functions, I concluded that users do not usually use timestamps for very far future dates, and decided to infer past days sometimes. Hence the algorithms.
Fair enough! Let's keep the current behavior then.
Clarification and motivation
In tzbot, we have many instances where the sender supplies partial information and we have to infer the rest. Some examples (there may be more I'm forgetting):
In the first 2 cases, we use a simple and easy to predict algorithm:
In other words, we always try to infer a point of time in the future. We use today's date, but if the time has already passed, we use the next suitable date in the nearest future.
In the last 2 cases though, we use a more complex algorithm:
https://github.com/serokell/tzbot/blob/635077e77d6c85ab9c1711076aa1d5970444e7aa/src/TzBot/TimeReference.hs#L169-L183
https://github.com/serokell/tzbot/blob/635077e77d6c85ab9c1711076aa1d5970444e7aa/src/TzBot/TimeReference.hs#L199-L204
I personally think we should use the same algorithm we use in the first two cases in the last two as well. It has the benefit of being easy to predict for users. Over time, as they use the bot, it'll be relatively easy to notice the pattern, so they'll realize they have to be more specific when they want to refer to a moment in the past.
Right now, it's not easy for users to predict what the bot will infer. As I write this, on the 14th Feb:
So I propose we use the simpler algorithm in all cases.
Acceptance criteria