Problem: At the moment, when we receive a "message edited" event, and if the old message is not in our cache or it did not contain time references, we ignore the event:
-- if not found or expired, just ignore this message
-- it's too old or just didn't contain any time refs
However, it's important to handle these events even when a message is not in the cache. For example:
A user types "let's meet at 7" and then amends "7" to "7am". The old message did not contain time refs, but the new one does, so we should handle that.
The server is restarted, we'll lose our cache. When the server is back up, we should still react when messages that were sent before the restart are edited.
Solution: If the old message's time refs are not found in the cache, inspect the previous_message field from the event JSON, and parse its time refs again.
Related issue(s)
Fixed #93
:white_check_mark: Checklist for your Pull Request
Related changes (conditional)
Tests
[ ] If I added new functionality, I added tests covering it.
[x] If I fixed a bug, I added a regression test to prevent the bug from
silently reappearing again.
Documentation
[x] I checked whether I should update the docs and did so if necessary:
Description
Problem: At the moment, when we receive a "message edited" event, and if the old message is not in our cache or it did not contain time references, we ignore the event:
However, it's important to handle these events even when a message is not in the cache. For example:
Solution: If the old message's time refs are not found in the cache, inspect the
previous_message
field from the event JSON, and parse its time refs again.Related issue(s)
Fixed #93
:white_check_mark: Checklist for your Pull Request
Related changes (conditional)
Tests
Documentation
Stylistic guide (mandatory)