-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#93] Handle edited events when old message is not in cache
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: 1. 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. 2. 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.
- Loading branch information
Showing
2 changed files
with
24 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters