Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(ingress): say an unparseable sweep interval fails the boot

Yudhi Armyndharis7cc7e2c38754
diff --git a/docs/25-integration-fabric.md b/docs/25-integration-fabric.md
index 09f9ebce0..850ff9ae5 100644
--- a/docs/25-integration-fabric.md
+++ b/docs/25-integration-fabric.md
@@ -239,8 +239,8 @@ route so the lane is one conversation; without it the lane is the whole instance
Persist-before-acknowledge alone is not delivery: a crash between the persist and the enqueue, or a
fire-and-forget enqueue on a `response` route whose outcome is never recorded, would strand the row
with the provider already acknowledged. The **ingress reconciler** closes that window: every
-`INGRESS_RECONCILE_INTERVAL_MS` (default 60s, `0` disables; a blank or unparseable value falls
-back to the default rather than disabling the sweep) it re-dispatches a bounded batch
+`INGRESS_RECONCILE_INTERVAL_MS` (default 60s, `0` disables; a blank value falls back to the
+default, and a negative or unparseable value fails the boot) it re-dispatches a bounded batch
(`INGRESS_RECONCILE_BATCH_SIZE`, default 50) of `pending` rows whose last activity is older than a
grace period (`INGRESS_RECONCILE_GRACE_MS`, default 60s), through the same queue-or-inline enqueue the
live path uses and with the original delivery id as job id, so a replay is idempotent against a job
diff --git a/src/modules/integration/ingress-reconciler.service.ts b/src/modules/integration/ingress-reconciler.service.ts
index 1e5c27b06..93d613800 100644
--- a/src/modules/integration/ingress-reconciler.service.ts
+++ b/src/modules/integration/ingress-reconciler.service.ts
@@ -18,8 +18,8 @@ import { createLogger } from '../../common/services/logger.service';
import { resolveNonNegativeIntEnv } from '../../config/configuration';
export interface IngressReconcilerOptions {
- // Sweep cadence. 0 disables the reconciler. A blank or otherwise unparseable value falls back to
- // the default rather than disabling the sweep, so a mis-set variable can never silently turn it off.
+ // Sweep cadence. 0 disables the reconciler. A blank value falls back to the default; boot validation
+ // refuses a negative or unparseable one, so a mis-set variable can never silently turn it off.
intervalMs: number;
// A 'pending' row only becomes sweep-eligible once its last activity (creation or latest attempt)
// is older than this — the live path gets the whole window to record its own outcome first.
diff --git a/src/modules/message/pending-message-reaper.service.ts b/src/modules/message/pending-message-reaper.service.ts
index 2be23fcb2..e4ab33c06 100644
--- a/src/modules/message/pending-message-reaper.service.ts
+++ b/src/modules/message/pending-message-reaper.service.ts
@@ -7,9 +7,9 @@ import { createLogger } from '../../common/services/logger.service';
import { resolveNonNegativeIntEnv } from '../../config/configuration';
export interface PendingMessageReaperOptions {
- // Sweep cadence. 0 disables the reaper (mirrors INGRESS_RECONCILE_INTERVAL_MS). A blank or
- // otherwise unparseable value falls back to the default rather than disabling the sweep, so a
- // mis-set variable can never silently turn the reaper off.
+ // Sweep cadence. 0 disables the reaper (mirrors INGRESS_RECONCILE_INTERVAL_MS). A blank value
+ // falls back to the default; boot validation refuses a negative or unparseable one, so a mis-set
+ // variable can never silently turn the reaper off.
intervalMs: number;
// An outgoing PENDING row only becomes reap-eligible once it is older than this — the live send
// path gets the whole window to persist its own SENT/FAILED outcome first.