Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
chore: correct stale source comments and a dead spec stub
Yudhi Armyndharis7245c80ff0ce
diff --git a/src/common/storage/storage.service.spec.ts b/src/common/storage/storage.service.spec.tsindex 6b2957777..7b460110e 100644--- a/src/common/storage/storage.service.spec.ts+++ b/src/common/storage/storage.service.spec.ts@@ -336,10 +336,9 @@ describe('StorageService.createExportStream enumerates the whole store', () => {const iterateFiles = jest.spyOn(service, 'iterateFiles').mockImplementation(async function* () {yield await Promise.resolve('media/a.bin');});- jest.spyOn(service, 'getFile').mockResolvedValue(Buffer.from('x'));-- // The enumerator runs before the archive is constructed, so which one was used is settled even- // if archiving itself cannot run in this environment. That is the whole claim here.+ // No read stub: the enumerator runs before the archive is constructed, and `archiver` is mocked+ // at the top of this file, so the call rejects there and no file is ever opened. Which+ // enumeration was used is settled by then, and that is the whole claim here.await service.createExportStream().catch(() => undefined);expect(iterateFiles).toHaveBeenCalled();diff --git a/src/modules/message/message-send.service.ts b/src/modules/message/message-send.service.tsindex b0878e781..5ec0cdb10 100644--- a/src/modules/message/message-send.service.ts+++ b/src/modules/message/message-send.service.ts@@ -210,8 +210,9 @@ export class MessageSendService {* Resolve a stored template, render its body (with optional header/footer* flattened using newlines) using the supplied variables, and delegate to the* existing {@link sendText} path so plugin hooks, persistence, and status- * tracking are reused. Throws NotFoundException when the template cannot be- * resolved by id or name.+ * tracking are reused. Throws NotFoundException when the identifier matches+ * nothing, BadRequestException when neither templateId nor templateName is+ * given.** The FINAL rendered text is capped at template.renderMaxChars (default 64 KiB): caller-supplied* variables can inflate a small template unboundedly, so an over-cap render is rejected with adiff --git a/src/modules/search/dto/search-query.dto.ts b/src/modules/search/dto/search-query.dto.tsindex a4cf7a4dd..84e7d2ef3 100644--- a/src/modules/search/dto/search-query.dto.ts+++ b/src/modules/search/dto/search-query.dto.ts@@ -7,10 +7,13 @@ import { ToStrictNumber } from '../../../common/utils/strict-boolean';/*** Request shape for GET /search. Numeric fields are coerced from query-string strings via- * `@Type(() => Number)` and then validated with `@IsNumber()` — so `?limit=abc` (Number('abc') →- * NaN) fails `@IsNumber()` and surfaces as a 400 from the global ValidationPipe, never reaching the- * provider as a NaN SQL param. `sessionIds` is intentionally absent: scope is injected by- * SearchService from the caller's API-key allowedSessions (never user-supplied).+ * `@Type(() => Number)` and then validated, so `?limit=abc` (Number('abc') → NaN) surfaces as a 400+ * from the global ValidationPipe, never reaching the provider as a NaN SQL param. The epoch-ms+ * bounds `dateFrom`/`dateTo` use `@IsNumber()`; `limit`/`offset` use `@IsInt()`, because they are+ * bound straight into `LIMIT ?`/`OFFSET ?` where better-sqlite3 rejects a fractional value with+ * SQLITE_MISMATCH: a fraction has to be a 400 here rather than a driver-level 500. `sessionIds` is+ * intentionally absent: scope is injected by SearchService from the caller's API-key+ * allowedSessions (never user-supplied).*/export class SearchQueryDto {@ApiProperty({ description: 'Search term (required, non-empty)' })