HomePhabricator
Diffusion Comm 5bae368c4381

[keyserver] Add function to fetch reactions/edits/sidebar_source for messages

Description

[keyserver] Add function to fetch reactions/edits/sidebar_source for messages

Summary:
issue: https://linear.app/comm/issue/ENG-3689/implement-fetching-edits-sidebar-source-and-reactions-for-message
Usinng the same query as we use everywhere to fetch messages - joining with uploads and memberships to be able to use parseMessageSQLResult to parse the results (as we do in other places).

For edits we need to fetch the newest edit only. This requires a subselect. I used a query from fetchLatestEditMessageContentByIDs to obtain the newest edit.

Test Plan: Artificially added edit messages to my db, checked that the function returns all edits / sidebar_sources / reactions for given messages.

Reviewers: kamil, bartek, rohan, ashoat

Reviewed By: ashoat

Subscribers: ashoat, tomek, atul

Differential Revision: https://phab.comm.dev/D7562