Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(session): correct the outbound archive race comment

Yudhi Armyndharise113f4023183
diff --git a/src/modules/session/message-projector.service.ts b/src/modules/session/message-projector.service.ts
index 3a3c6218e..410d70378 100644
--- a/src/modules/session/message-projector.service.ts
+++ b/src/modules/session/message-projector.service.ts
@@ -750,7 +750,8 @@ export class MessageProjector {
// Archive this send's media, mirroring onMessage. This is the ONLY path a phone-composed
// send takes, so the REST-side chokepoint would never see it. Opt-in twice over
// (CHAT_MEDIA_ARCHIVE_ENABLED + _OUTBOUND) and a no-op otherwise; archive() itself
- // refuses a row that is already archived, so the REST writer racing us costs nothing.
+ // refuses a row that is already archived, so the REST writer racing us costs at most one
+ // duplicate file write, which archive() deletes because the first pointer wins.
if (this.configService?.get<boolean>('chatMedia.archiveOutbound', false) === true) {
void this.chatMediaArchive?.archive(dbMessage).catch(() => undefined);
}