Page MenuHomePhabricator

[keyserver] Add function for fetching RawMessageInfo for rows and their related messages

Authored by inka on Apr 24 2023, 2:11 AM.
Referenced Files
Unknown Object (File)
Fri, Jun 14, 9:17 AM
Unknown Object (File)
Wed, Jun 12, 8:55 PM
Unknown Object (File)
Wed, Jun 12, 7:33 AM
Unknown Object (File)
Mon, Jun 10, 4:56 AM
Unknown Object (File)
Sat, Jun 8, 5:39 PM
Unknown Object (File)
Sat, Jun 8, 6:48 AM
Unknown Object (File)
Sat, Jun 8, 1:50 AM
Unknown Object (File)
Fri, Jun 7, 11:49 PM



This function takes rows from messages table, and returns RawMessageInfo for those rows and messages related, ie edits, reactions and sidebar_sources.
For sidebar_source, edit_message and reaction messages there are no sidebar_source, edit_message and reaction messages (user cannot react to a reaction message etc). So those messages are not passed to
fetchRelatedMessages function.

Test Plan

Called the function on some rows, checked that all related messages are returned (and the messages from the rows).

Diff Detail

rCOMM Comm
Lint Not Applicable
Tests Not Applicable

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Apr 24 2023, 2:25 AM
Harbormaster failed remote builds in B18683: Diff 25589!
inka requested review of this revision.Apr 25 2023, 4:15 AM
750 ↗(On Diff #25651)

Realizing this error message should be updated to mention TOGGLE_PIN

(Please adjust to keep under 80 chars)

900–902 ↗(On Diff #25651)

Since we use this also on line 747, can we factor it out into a function in lib/types/message-types.js?

(Also look for other cases where it should be used in the codebase)

750 ↗(On Diff #25651)

Or maybe make this error message more generic to avoid having to update the message if we added other message types in the future.
The extracted function name of this check (comment below on L900) could potentially be used.

900–902 ↗(On Diff #25651)

I added D7632 to address this, with an explanation why I did it the way I did it, but honestly I think it's worse. I will change this if D7632 is accepted.

900–902 ↗(On Diff #25651)

@bartek showed me a better way of doing that (in D7632), and now I think it's fine.
I will still wait for D7632 to be accepted, in case the reviewers don't like the functions name or something

This revision is now accepted and ready to land.Apr 27 2023, 1:29 PM