HomePhabricator
Diffusion Comm 2561eee5cb96

[keyserver] await dbQuery in updateLatestMessages

Description

[keyserver] await dbQuery in updateLatestMessages

Summary:
The unused-promise Lint identified an issue here. updateLatestMessages gets called from postMessageSend, and we make sure to handle promise rejections there.

But since we don't await the call to updateLatestMessages from that code, there's a potential that the dbQuery inside updateLatestMessages fails. This promise rejection would not be handled, and as such would crash the keyserver.

This diff allows us to pass those promise rejections through to postMessageSend, which avoids the issue.

I considered simply returning the dbQuery Promise (async/await syntax isn't really necessary here), but it's a little more annoying because we have an early exit at the start of the function.

Depends on D10180

Test Plan: Flow

Reviewers: michal

Reviewed By: michal

Subscribers: tomek

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

Details

Provenance
ashoatAuthored on Dec 4 2023, 12:39 PM
Reviewer
michal
Differential Revision
D10181: [keyserver] await dbQuery in updateLatestMessages
Parents
rCOMM0c0477a7c0f0: [keyserver] await file operations for devs in MariaDB migrations
Branches
Unknown
Tags
Unknown