Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
docs(integration): state that the integration DLQ holds inbound deliveries (#1804)
Yudhi Armyndharis98fbdfb3f32f
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 46218e67c..1f7f3a548 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -78,6 +78,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0### Documentation+- The integration docs say `integration_delivery_failures` holds only failed inbound deliveries.- The webhook runbook documents the ADMIN delivery-failure redrive and no longer says failed deliveries retry on their own.### Upgrade notes (behavior changes)diff --git a/docs/05-database-design.md b/docs/05-database-design.mdindex d5fe0b19f..7c5f44b59 100644--- a/docs/05-database-design.md+++ b/docs/05-database-design.md@@ -714,7 +714,7 @@ The data connection also owns:- **`plugin_instances`** — one configured instance of an adapter plugin, keyed `${pluginId}:${instanceId}` (`src/modules/integration/entities/plugin-instance.entity.ts`); holds the host-minted ingress HMAC secret, masked on API reads.- **`ingress_events`** — persist-before-ack durable row and inbound dedup oracle, unique on `(pluginId, instanceId, providerDeliveryId)` (`src/modules/integration/entities/ingress-event.entity.ts`). The full payload is retired to `NULL` once dispatch is settled, leaving a slim dedup marker.- **`conversation_mappings`** — bidirectional WA-chat ↔ provider-conversation mapping plus handover state (`src/modules/integration/entities/conversation-mapping.entity.ts`).-- **`integration_delivery_failures`** — DLQ-of-record for both inbound (ingress) and outbound (provider egress) delivery failures (`src/modules/integration/entities/integration-delivery-failure.entity.ts`).+- **`integration_delivery_failures`** — DLQ-of-record for failed inbound (ingress) deliveries, the rows the instance redrive replays; only the ingress path writes it, so `direction` is always `inbound` (`src/modules/integration/entities/integration-delivery-failure.entity.ts`).- **`baileys_stored_messages`** — Baileys engine message store — the serialized WAMessage proto (`src/engine/adapters/baileys-stored-message.entity.ts`); present only when the Baileys engine is used. (Credentials live on the filesystem, not here.)- **`lid_mappings`** — LID↔phone-number identity mappings (`src/engine/identity/lid-mapping.entity.ts`).- **`chat_states`** (engine): per-session mute, archive and pin state of each Baileys chat (`src/engine/adapters/baileys-chat-state.entity.ts`), keyed `(sessionId, chatId)`. `chatId` is the person's phone JID (`<phone>@s.whatsapp.net`) whenever their lid resolves, so a state WhatsApp syncs under the lid and one set through the phone number land on the same row; it stays `<lid>@lid` while the lid is unresolved, and a row found under the lid later is folded onto the phone JID on the chat's next change (reads and the fold take each field from the newest row that observed it: `observed` lists the fields a row has seen, and null, on a row not written since the column was added, means the fields it holds a set value for; the next write that can read the row records the list). WhatsApp does not re-deliver that state, so it is kept in backups. A chat deleted on the phone or through the API loses its row, so a later message starts it clean.diff --git a/docs/25-integration-fabric.md b/docs/25-integration-fabric.mdindex 041dd589f..189bd15e1 100644--- a/docs/25-integration-fabric.md+++ b/docs/25-integration-fabric.md@@ -160,8 +160,9 @@ Four tables live on the data connection, each created by a hand-authored dual-dirows are pruned on their own short window (`INGRESS_DEDUP_RETENTION_DAYS`, default 7 — a deduporacle is not an audit log, and `<= 0` falls back to the default rather than disabling the pruneinto unbounded growth).-- **`integration_delivery_failures`** — a dead-letter record of last resort for both directions, with a- redrive path (added in P1).+- **`integration_delivery_failures`** — a dead-letter record of last resort for inbound (ingress)+ deliveries, with a redrive path (added in P1). Only the ingress path writes it, so every row's+ `direction` is `inbound`; a failed outbound call to the provider is not dead-lettered.## 25.6 Security modeldiff --git a/src/modules/integration/entities/integration-delivery-failure.entity.ts b/src/modules/integration/entities/integration-delivery-failure.entity.tsindex 5354535d9..e5ae7baf3 100644--- a/src/modules/integration/entities/integration-delivery-failure.entity.ts+++ b/src/modules/integration/entities/integration-delivery-failure.entity.ts@@ -2,8 +2,9 @@ import { Column, CreateDateColumn, Entity, Index, PrimaryGeneratedColumn } fromimport { jsonColumnType } from '../../../common/utils/column-types';import { NulFreeTransformer } from '../../../common/transformers/nul-free.transformer';-// DLQ-of-record for both inbound (ingress) and outbound (provider egress) delivery failures.-// Generalizes webhook_delivery_failures. sessionId is provenance (no FK).+// DLQ-of-record for failed inbound (ingress) deliveries; only the ingress path writes it and redrive+// replays only 'inbound' rows. 'outbound' is reserved: nothing writes it. Generalizes+// webhook_delivery_failures. sessionId is provenance (no FK).@Entity('integration_delivery_failures')@Index('IDX_integration_delivery_failures_instance', ['pluginId', 'instanceId'])export class IntegrationDeliveryFailure {