Page MenuHomePhabricator

[lib] Fix DM push notifs code to fetch message from SQLite instead of Redux
ClosedPublic

Authored by ashoat on Feb 11 2025, 12:22 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Mar 29, 3:58 PM
Unknown Object (File)
Tue, Mar 11, 4:16 PM
Unknown Object (File)
Tue, Mar 11, 3:48 PM
Unknown Object (File)
Thu, Mar 6, 8:08 PM
Unknown Object (File)
Feb 27 2025, 9:43 AM
Unknown Object (File)
Feb 27 2025, 4:40 AM
Unknown Object (File)
Feb 25 2025, 10:54 AM
Unknown Object (File)
Feb 25 2025, 7:31 AM
Subscribers
None

Details

Summary

This code fetches a message that is reacted to in order to check its author, but it's currently set up to only check Redux.

Instead, we should query SQLite in case the message is not currently in Redux. getLatestMessageEdit also contains a fallback to check Redux if the data is not in SQLite yet.

Technically getLatestMessageEdit doesn't return just the RawMessageInfo that was queried for; rather, it returns the latest edit (only applies to messageTypes.TEXT). I think this is fine in this case, since we only need to use the creatorID. It might be preferable in a future use case, but hard to know for sure.

Depends on D14337

Test Plan

Tested in combination with later diffs, to confirm that it's possible for some message types to not set a thread to unread

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable