[lib] Add timestamp check when flipping unread status
Summary:
This diff fixes messages appearing unread by adding a timestamp check when getting new messages.
https://linear.app/comm/issue/ENG-9727/thick-threads-appearing-unread
Test Plan:
- User A logs to web and mobile
- User B logs to web
- User's A mobile is in background
- User B sends DM to A
- User A reads the message on web
- User A brings mobile back to foreground. Verify the last message is not unread.
- Repeat a few times
Reviewers: kamil, tomek
Reviewed By: tomek
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D13766