A few serviceId fixes

Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
Fedor Indutny 2023-08-11 19:27:10 +02:00 committed by Jamie Kyle
parent 1f963efd64
commit deb1f9bd8d
3 changed files with 14 additions and 3 deletions

View file

@ -3,6 +3,7 @@
import { chunk } from 'lodash'; import { chunk } from 'lodash';
import type { LoggerType } from '../../types/Logging'; import type { LoggerType } from '../../types/Logging';
import { normalizeAci } from '../../types/ServiceId';
import { getSendOptions } from '../../util/getSendOptions'; import { getSendOptions } from '../../util/getSendOptions';
import type { SendTypesType } from '../../util/handleMessageSend'; import type { SendTypesType } from '../../util/handleMessageSend';
import { handleMessageSend } from '../../util/handleMessageSend'; import { handleMessageSend } from '../../util/handleMessageSend';
@ -147,9 +148,18 @@ export async function runSyncJob({
} }
} }
const aciSyncs = syncs.map(({ senderUuid, ...rest }) => {
return {
...rest,
senderAci: senderUuid
? normalizeAci(senderUuid, 'syncHelpers.senderUuid')
: undefined,
};
});
try { try {
await Promise.all( await Promise.all(
chunk(syncs, CHUNK_SIZE).map(batch => { chunk(aciSyncs, CHUNK_SIZE).map(batch => {
const messageIds = batch.map(item => item.messageId).filter(isNotNil); const messageIds = batch.map(item => item.messageId).filter(isNotNil);
return handleMessageSend(doSync(batch, sendOptions), { return handleMessageSend(doSync(batch, sendOptions), {

View file

@ -1947,8 +1947,9 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
strictAssert(id, 'Quote must have an id'); strictAssert(id, 'Quote must have an id');
const result: QuotedMessageType = { const result: QuotedMessageType = {
...quote, ...omit(quote, 'authorAci'),
authorUuid: quote.authorAci,
id, id,
attachments: quote.attachments.slice(), attachments: quote.attachments.slice(),

View file

@ -1455,7 +1455,7 @@ export default class MessageSender {
async syncReadMessages( async syncReadMessages(
reads: ReadonlyArray<{ reads: ReadonlyArray<{
senderUuid?: string; senderAci?: AciString;
senderE164?: string; senderE164?: string;
timestamp: number; timestamp: number;
}>, }>,