Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
docs(baileys): say what a held change waits for and what is not covered
Yudhi Armyndharis48b71bc85136
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 83bd21128..381b9a6df 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -74,7 +74,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0- Bound the inbound media a PostgreSQL session holds before storing it to `INBOUND_MEDIA_CONCURRENCY` payloads, keeping each chat's arrival order.- Drop a Baileys edit, revoke or reaction from another chat, an edit from the wrong author, or a one-to-one revoke from the other side, aimed at a message still being downloaded, on SQLite too.- Drop a Baileys message that reuses the id of one still being downloaded under another chat or sender, so it cannot take the id or stand in for the original when a later delete is judged.-- Drop the stored copy of a Baileys message that reuses the id of a message the gateway already holds under another chat, sender or direction, and hold an edit, delete or reaction aimed at that id until the gateway has settled the message, so the real message's change is no longer ignored as foreign.+- Drop the stored copy of a Baileys message that reuses the id of a message the gateway already holds under another chat, sender or direction, and hold an edit, delete or reaction that reads as foreign to that copy until the gateway has settled the message, so the real message's change is no longer ignored as foreign; a reusing message deleted by its sender while it downloads on SQLite, or skipped as ephemeral, is never settled and keeps its copy.- Warn at storage export when a file is larger than the per-entry import cap `STORAGE_IMPORT_MAX_BYTES`.- Refuse a `PORT` with surrounding whitespace at boot instead of binding a port the image healthcheck cannot probe.- Skip or cancel the Baileys version lookup of a session stopped while it connects, so no proxy dispatcher outlives it.diff --git a/docs/03-system-architecture.md b/docs/03-system-architecture.mdindex b4da3bcd2..e43ad560a 100644--- a/docs/03-system-architecture.md+++ b/docs/03-system-architecture.md@@ -926,6 +926,9 @@ export interface EngineEventCallbacks {author?: string;}) => InboundTicket | undefined; // PostgreSQL: reserves room for a download before the emit, and holds a change to the chat, direction and author it namesonMessage?: (message: IncomingMessage, ticket?: InboundTicket) => void | InboundReceipt; // the receipt reports { conflict: true } when the id already held another message; Baileys drops its copy+ // A change aimed at that id that reads as foreign to the engine's copy waits for the receipt: up to 3 media download+ // timeouts for a message still being processed, then 5 minutes for the session, at most 64 changes at once. A change+ // that cannot wait, or is still waiting when the time runs out, is dropped.onMessageCreate?: (message: IncomingMessage, ticket?: InboundTicket) => void; // outgoing (incl. linked-phone sends)onMessageAck?: (messageId: string, status: DeliveryStatus, chatId?: string) => void;onMessageRevoked?: (message: RevokedMessage, actor?: { fromMe: boolean }) => void;diff --git a/src/engine/interfaces/whatsapp-engine.interface.ts b/src/engine/interfaces/whatsapp-engine.interface.tsindex 3ebba0939..1e745b16e 100644--- a/src/engine/interfaces/whatsapp-engine.interface.ts+++ b/src/engine/interfaces/whatsapp-engine.interface.ts@@ -896,8 +896,12 @@ export interface EngineEventCallbacks {/*** Fired for each received message. The session may answer with a receipt for what it makes of the* message once its row is settled (see {@link InboundReceipt}); the engine never holds the message back- * for it, though a change aimed at that message waits for it before it is judged, and a receipt that- * fails, or is still unsettled after minutes, is let go of.+ * for it. A change aimed at that message waits for the receipt only when it reads as foreign to the+ * copy the engine holds under its id; one from that copy's own chat and author is not delayed. A receipt+ * that fails, or is still unsettled after minutes, is let go of. No receipt comes for a message the+ * session skips as ephemeral, nor for one the engine does not emit because its sender deleted it while+ * it was processed and nothing holds it from its arrival (SQLite): the engine's copy of such a message+ * that reuses another message's id is not reported as a conflict, and stays.*/onMessage?: (message: IncomingMessage, ticket?: InboundTicket) => void | InboundReceipt;/**