Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

fix(status): tolerate an absent ConfigService in the status seed cap lookup

Yudhi Armyndharis78fb80c3d717
diff --git a/src/modules/session/session.service.ts b/src/modules/session/session.service.ts
index 81c988590..2a7c323a2 100644
--- a/src/modules/session/session.service.ts
+++ b/src/modules/session/session.service.ts
@@ -674,7 +674,8 @@ export class SessionService implements OnModuleDestroy, OnModuleInit, OnApplicat
// this is a backfill of posts that predate the connection, not a live arrival.
// Pre-gate media downloads at the store's own cap: a larger blob would be discarded as
// over_cap on ingest anyway, so downloading it is pure waste (heap + bandwidth).
- const mediaMaxBytes = this.configService.get<number>('status.mediaMaxBytes', DEFAULT_MEDIA_MAX_BYTES);
+ const mediaMaxBytes =
+ this.configService?.get<number>('status.mediaMaxBytes', DEFAULT_MEDIA_MAX_BYTES) ?? DEFAULT_MEDIA_MAX_BYTES;
const messages = await engine.getChatHistory('status@broadcast', STATUS_SEED_LIMIT, true, mediaMaxBytes);
// getChatHistory maps a message's contact from the sync cache only, so status posters (usually
// @lid ids) come back nameless. Resolve each unique poster once via getContactById — the same