ChatStorage: memoize messages, add find_previous_from
What does this MR do and why?
Updates ChatStorage
& ChatMessage
before implementing !138153 (merged).
- Memoize ChatStorage#messages, since there is a need to access them a few times during the same request.
- Implement ChatStorage#find_previous_from for finding particular previous message
- Implement ChatMessage#== (which compares only id since ChatMessage is an entity)
Existing functionality are not affected.
Note: This will be easier to review commit by commit.
How to set up and validate locally
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #430975
Edited by Mark Chao