Keywords: creating a keyword with "Send text" fails with `invalid input syntax for type bigint: ""`
Have you checked for existing requests?
- [x] I have searched the existing issues and found no similar request.
Affected Component
⚙️ Keywords Automation
Deployment Environment
Self-Hosted (Docker Compose)
ChatbotX Version
v1.17.1 (official images tagged 1.17.1, run on Docker Swarm via Easypanel)
Describe the bug
Creating a contact keyword in text mode ("Send text") always fails with the toast "Something went wrong while executing the operation." Nothing is saved. The builder log shows the database error invalid input syntax for type bigint: "". Keywords that reply with a flow work fine.
From reading the code (the same lines are on main):
- create-automated-response-form.tsx: the form default is
flowId: "", and the "Send text" tab callssetValue("flowId", ""). - createAutomatedResponseRequest allows it on purpose:
flowId: z.string().length(0).or(zodBigintAsString()). - packages/business/src/automated-response/service.ts, create():
const flowId = values.flowId ?? undefinedkeeps the empty string, which is then inserted into the bigint "flowId" column. I did not check whether update() has the same pattern.
Steps To Reproduce
- Keywords -> Create automated response (/space/
/automated-responses/create). - Type a keyword, e.g. "test".
- Choose "Send text" and type any text.
- Click Confirm.
Expected behavior
The keyword is saved with the text reply and a null flowId.
Screenshots or Error Logs
Failed query: insert into "AutomatedResponse" ("id", "createdAt", "updatedAt", "workspaceId", "folderId", "keywords", "status", "text", "flowId", "type") values ($1, default, default, $2, $3, $4, $5, $6, $7, $8) returning ...
params:
Suggested fix: const flowId = values.flowId || undefined in create().
I'll take this — empty flowId ("") from the "Send text" form should coerce to undefined before hitting the bigint column (values.flowId || undefined in create/update). Planning a focused fix + regression test.
Looks like this was fixed on main in #1617 (const flowId = values.flowId || undefined in automated-response/service.ts create). Withdrawing my claim — happy for a maintainer to close if the v1.17.1 report is covered by that release train.