fix(api+cli): topic post messageId is the durable historyId (v1.9.2)
Some checks failed
CI / Lint (push) Has been cancelled
CI / Typecheck (push) Has been cancelled
CI / Broker tests (Postgres) (push) Has been cancelled
CI / Docker build (linux/amd64) (push) Has been cancelled

Previously POST /v1/messages returned the message_queue row id as
`messageId`. Topic posts ARE durable (in topic_message); the queue
entry drains on delivery. Pasting that id into `--reply-to` failed
because the broker validates parents against topic_message, not the
queue. Now `messageId` aliases `historyId` for topic posts; both
`historyId` and `queueId` remain available as explicit fields.

Roadmap and CLI README updated with v0.3.1 reply-to + v0.3.2
multi-session entries.
This commit is contained in:
Alejandro Gutiérrez
2026-05-02 22:10:13 +01:00
parent 716e674473
commit 8697c1c032
4 changed files with 33 additions and 3 deletions

View File

@@ -254,9 +254,15 @@ export const v1Router = new Hono<Env>()
}
}
// For topic posts the durable identity is the topic_message row;
// the message_queue row is ephemeral (drains on delivery). Return
// historyRow.id as `messageId` so callers that paste the response
// back into `--reply-to` actually find the parent in history.
// `historyId` and `queueId` are kept as explicit aliases.
return c.json({
messageId: queueRow?.id ?? null,
messageId: historyRow?.id ?? queueRow?.id ?? null,
historyId: historyRow?.id ?? null,
queueId: queueRow?.id ?? null,
topic: body.topic,
topicId: topic.id,
notifications,