Page MenuHomePhabricator

[keyserver] Make rawMessageInfoFromRows return a Promise
ClosedPublic

Authored by ashoat on Jul 13 2022, 9:08 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 2, 6:32 PM
Unknown Object (File)
Sat, Nov 2, 6:32 PM
Unknown Object (File)
Sat, Nov 2, 6:32 PM
Unknown Object (File)
Sat, Nov 2, 6:31 PM
Unknown Object (File)
Sat, Nov 2, 6:21 PM
Unknown Object (File)
Tue, Oct 29, 7:26 PM
Unknown Object (File)
Thu, Oct 24, 5:12 AM
Unknown Object (File)
Thu, Oct 24, 3:51 AM

Details

Summary

In D4521 we end up needing to await getDBType() in the message-fetchers.js code because we need to parse the query results differently depending on whether it came from MySQL 5.7 or MariaDB 10.8.

Depends on D4518

Test Plan

Flow; tested in combination with next diffs

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Not super qualified to review js, but the intention looks right

The change makes sense, but explaining the higher level motivation in the Summary section could be helpful

keyserver/src/fetchers/message-fetchers.js
138 ↗(On Diff #14438)

Maybe parsedMessages instead of parseResults, but doesn't really matter

193–196 ↗(On Diff #14438)

My personal preference would be something a little less verbose like:

return !rawMessageInfo ? null : { rawMessageInfo, rows: messageRows };

But I know everyone has an opinion on when/where to use ternaries, so feel free to disregard.

This revision is now accepted and ready to land.Jul 15 2022, 12:39 PM