Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(api): correct the muteExpiration write-back contract for indefinite mutes

Yudhi Armyndharis2b64eb59c7f4
diff --git a/openapi.json b/openapi.json
index 84f4e2304..7931869fd 100644
--- a/openapi.json
+++ b/openapi.json
@@ -10476,7 +10476,7 @@
},
"muteExpiration": {
"type": "number",
- "description": "Epoch MILLISECONDS at which the mute ends, present only when muted is true; 0 means muted indefinitely. Milliseconds is the same unit as POST /sessions/{sessionId}/chats/mute muteUntil, so a value read here can be written straight back.",
+ "description": "Epoch MILLISECONDS at which the mute ends, present only when muted is true; 0 means muted indefinitely. Milliseconds is the same unit as POST /sessions/{sessionId}/chats/mute muteUntil, so a finite value can be written straight back. The 0 an indefinite mute reports is the exception: muteUntil requires a real future instant, so re-apply an indefinite mute with a far-future timestamp rather than 0.",
"example": 1786003600000
}
},
diff --git a/src/engine/interfaces/whatsapp-engine.interface.ts b/src/engine/interfaces/whatsapp-engine.interface.ts
index cb1cf38bb..6777d2a9e 100644
--- a/src/engine/interfaces/whatsapp-engine.interface.ts
+++ b/src/engine/interfaces/whatsapp-engine.interface.ts
@@ -504,8 +504,10 @@ export interface ChatSummary {
/**
* Epoch MILLISECONDS at which the mute ends, present only when `muted` is true; `0` means muted
* indefinitely. Milliseconds is the same unit as `POST /sessions/{sessionId}/chats/mute`
- * `muteUntil`, so a value read here can be written straight back (`mute-chat.dto.ts` documents that
- * unit and why a seconds value is a trap).
+ * `muteUntil`, so a FINITE value can be written straight back (`mute-chat.dto.ts` documents that
+ * unit and why a seconds value is a trap). The `0` an indefinite mute reports is the exception:
+ * `muteUntil` requires a real future instant, so re-apply an indefinite mute with a far-future
+ * timestamp rather than `0`.
*/
muteExpiration?: number;
}
diff --git a/src/modules/session/dto/chat-summary.dto.ts b/src/modules/session/dto/chat-summary.dto.ts
index 38896064f..69359719d 100644
--- a/src/modules/session/dto/chat-summary.dto.ts
+++ b/src/modules/session/dto/chat-summary.dto.ts
@@ -46,7 +46,9 @@ export class ChatSummaryDto {
description:
'Epoch MILLISECONDS at which the mute ends, present only when muted is true; 0 means muted ' +
'indefinitely. Milliseconds is the same unit as POST /sessions/{sessionId}/chats/mute ' +
- 'muteUntil, so a value read here can be written straight back.',
+ 'muteUntil, so a finite value can be written straight back. The 0 an indefinite mute reports ' +
+ 'is the exception: muteUntil requires a real future instant, so re-apply an indefinite mute ' +
+ 'with a far-future timestamp rather than 0.',
example: 1786003600000,
})
muteExpiration?: number;