HomePhabricator
Diffusion Comm 1e335ed953dc

[keyserver] Start inserting into messages table before calling postMessageSend

Description

[keyserver] Start inserting into messages table before calling postMessageSend

Summary:
The await in front of postMessageSend was added in D417. Here's how it works now:

  1. In a script context, we would wait for postMessageSend to complete before inserting into the MySQL messages table
  2. Outside of a script context, we would first call postMessageSend (no await though), and then insert into the MySQL messages table

After this diff, we'll first start inserting into the MySQL messages table (no await), and then call postMessageSend. I think D417 should have been implemented this way from the start, since the insertion into the messages table does not depend on postMessageSend. postMessageSend just needs to be resolved before createMessages resolves.

Depends on D6768

Test Plan: I tested and made sure notifs and associated other things worked correctly

Reviewers: tomek, atul

Reviewed By: atul

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