Wait for `ConversationController` load in receipt and sync jobs

This commit is contained in:
Evan Hahn 2021-12-16 11:45:56 -06:00 committed by GitHub
parent 29c3b8af89
commit ed96e603ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 0 deletions

View File

@ -102,6 +102,8 @@ export async function runReadOrViewSyncJob({
return;
}
await window.ConversationController.load();
const ourConversation =
window.ConversationController.getOurConversationOrThrow();
const sendOptions = await getSendOptions(ourConversation.attributes, {

View File

@ -7851,6 +7851,20 @@
"reasonCategory": "usageTrusted",
"updated": "2021-10-22T00:52:39.251Z"
},
{
"rule": "jQuery-load(",
"path": "ts/jobs/helpers/readAndViewSyncHelpers.js",
"line": " await window.ConversationController.load();",
"reasonCategory": "falseMatch",
"updated": "2021-12-15T19:58:28.089Z"
},
{
"rule": "jQuery-load(",
"path": "ts/jobs/helpers/readAndViewSyncHelpers.ts",
"line": " await window.ConversationController.load();",
"reasonCategory": "falseMatch",
"updated": "2021-12-15T19:58:28.089Z"
},
{
"rule": "jQuery-load(",
"path": "ts/jobs/normalMessageSendJobQueue.js",
@ -8152,6 +8166,20 @@
"updated": "2021-08-18T18:22:55.307Z",
"reasonDetail": "Legacy code"
},
{
"rule": "jQuery-load(",
"path": "ts/util/sendReceipts.js",
"line": " await window.ConversationController.load();",
"reasonCategory": "falseMatch",
"updated": "2021-12-15T19:58:28.089Z"
},
{
"rule": "jQuery-load(",
"path": "ts/util/sendReceipts.ts",
"line": " await window.ConversationController.load();",
"reasonCategory": "falseMatch",
"updated": "2021-12-15T19:58:28.089Z"
},
{
"rule": "jQuery-$(",
"path": "ts/util/setupI18n.js",

View File

@ -79,6 +79,8 @@ export async function sendReceipts({
new Map()
);
await window.ConversationController.load();
await Promise.all(
map(receiptsBySenderId, async ([senderId, receiptsForSender]) => {
const sender = window.ConversationController.get(senderId);