Move to MessageCache.saveMessage, queue downloads piecemeal

This commit is contained in:
Scott Nonnenberg 2025-01-24 06:37:18 -10:00 committed by GitHub
parent 197660a966
commit ed30059bd5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 138 additions and 298 deletions

View file

@ -124,12 +124,11 @@ export async function onSync(sync: ViewSyncAttributesType): Promise<void> {
const attachments = message.get('attachments');
if (!attachments?.every(isDownloaded)) {
const updatedFields = await queueAttachmentDownloads(
message.attributes,
{ urgency: AttachmentDownloadUrgency.STANDARD }
);
if (updatedFields) {
message.set(updatedFields);
const didQueueDownload = await queueAttachmentDownloads(message, {
urgency: AttachmentDownloadUrgency.STANDARD,
});
if (didQueueDownload) {
didChangeMessage = true;
}
}
}