Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs: say the data import drops NUL from cleaned text

Yudhi Armyndharis3a404060f384
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9323ae720..068087387 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -255,6 +255,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- A request body holding a NUL character is refused with `400` instead of failing with `500` on PostgreSQL, and an MCP tool input holding one gets a `BadRequestException` tool error instead of `Internal error`; `POST /api/infra/import-data` and the ingress route still accept one.
- On PostgreSQL, a NUL character in received message text, a status, an archived media type or a dead-letter error is dropped when stored instead of failing the write, so a history sync no longer loses the rest of its batch.
- On PostgreSQL, a NUL character in the account's own profile name is dropped when a session turns ready, instead of failing the write that binds its phone number.
+- `POST /api/infra/import-data` drops a NUL character from the message, status, profile-name and dead-letter text it restores, so a SQLite backup with one in that text restores on PostgreSQL instead of rolling back.
- An ingress delivery whose plugin error holds a NUL character is dead-lettered on PostgreSQL instead of being re-queued or replayed without end.
- A replica that starts while Redis is unreachable subscribes to cross-replica WebSocket events once Redis returns, instead of missing them until a restart.
- Status media received without a type is served as `application/octet-stream` instead of answering `404` on the `mediaUrl` it was advertised with.
diff --git a/docs/06-api-specification.md b/docs/06-api-specification.md
index 68cfca043..75767cfbb 100644
--- a/docs/06-api-specification.md
+++ b/docs/06-api-specification.md
@@ -107,7 +107,7 @@ A few refusals add a stable machine-readable `code`, so a client can branch with
| `IMPORT_NESTED_TRANSACTION` | `409` | Another database transaction is open on the connection; retry with no other data operation in flight |
| `EXPORT_IN_PROGRESS` | `409` | A data export is in progress; retry the import after it finishes |
-Validation failures (`statusCode: 400`) return `message` as an **array** of field-level strings, with `error: "Bad Request"`, when field detail is enabled: by default outside production, or anywhere with `VALIDATION_ERROR_DETAIL=true`. Under `NODE_ENV=production` (the Docker image, compose and Helm default) detail is off unless that variable is set, and the body is only `{ "statusCode": 400, "message": "Bad Request" }`. Clients should accept `message` as either a string or an array of strings. A global `ValidationPipe` runs with `whitelist` + `forbidNonWhitelisted`, so any request-body field not declared on the DTO is rejected with `400`. A request whose path or query string contains `%00`, or whose body holds a NUL character (U+0000) in any string, is refused with `400` before the route runs. Two routes are exempt from the body check: `POST /api/infra/import-data` accepts a backup holding one, and the ingress route (`/api/ingress/:pluginId/:instanceId/:path`) reads its body raw and hands it to its plugin as delivered. Message text, captions, contact names and the account's own profile name received from WhatsApp are stored without NUL characters.
+Validation failures (`statusCode: 400`) return `message` as an **array** of field-level strings, with `error: "Bad Request"`, when field detail is enabled: by default outside production, or anywhere with `VALIDATION_ERROR_DETAIL=true`. Under `NODE_ENV=production` (the Docker image, compose and Helm default) detail is off unless that variable is set, and the body is only `{ "statusCode": 400, "message": "Bad Request" }`. Clients should accept `message` as either a string or an array of strings. A global `ValidationPipe` runs with `whitelist` + `forbidNonWhitelisted`, so any request-body field not declared on the DTO is rejected with `400`. A request whose path or query string contains `%00`, or whose body holds a NUL character (U+0000) in any string, is refused with `400` before the route runs. Two routes are exempt from the body check: `POST /api/infra/import-data` accepts a backup holding one and drops it from the stored text listed below, so a SQLite backup with a NUL there restores on PostgreSQL, and the ingress route (`/api/ingress/:pluginId/:instanceId/:path`) reads its body raw and hands it to its plugin as delivered. Message text, captions, chat and contact names, media types and the account's own profile name received from WhatsApp, and dead-letter errors, are stored without NUL characters.
### General Error Codes