Each message a contact sends in a direct chat, that is each one GET /api/v1/chats/{id}/messages shows as received, is posted to each webhook on that chat: POST, Content-Type: application/json, body {"chat_id":3,"message":{...}} with the record from internal/api/messages.go. Delivery lives in internal/api/deliveries.go, beside the webhooks it reads. The event handler only calls Deliveries.Add, which queues the message or, with 100 already waiting, drops it and logs that; four goroutines read the chat's webhooks and make one POST to each, with a 10-second timeout and no retry. The README documents the payload, what delivery promises and both log lines.
What the diff does not show:
bot.Run stops the deliveries last, once the chat client has exited, so posting goes on while the API and the chat client stop. Posts still in progress then are abandoned, and logged as failures with context canceled.
Chats 1 and 2 get no deliveries: registering a webhook on either is 404.
Disclosures:
Judgement call: redirects are not followed, and a 3xx is logged like any other status that is not 2xx; following one can turn the POST into a GET without the message.
Judgement call: the logged error is Go's own with the URL taken out, so it can name the webhook's host, never its path, query or credentials.
Judgement call: the README lists the two warnings only. Encoding a message as JSON, logged as an error if it fails, cannot fail for a message the chat client sent.
Model: opus-5-5
Implements https://git.eeqj.de/sneak/simplexcalc/issues/7.
Each message a contact sends in a direct chat, that is each one `GET /api/v1/chats/{id}/messages` shows as `received`, is posted to each webhook on that chat: `POST`, `Content-Type: application/json`, body `{"chat_id":3,"message":{...}}` with the record from `internal/api/messages.go`. Delivery lives in `internal/api/deliveries.go`, beside the webhooks it reads. The event handler only calls `Deliveries.Add`, which queues the message or, with 100 already waiting, drops it and logs that; four goroutines read the chat's webhooks and make one POST to each, with a 10-second timeout and no retry. The README documents the payload, what delivery promises and both log lines.
What the diff does not show:
- `bot.Run` stops the deliveries last, once the chat client has exited, so posting goes on while the API and the chat client stop. Posts still in progress then are abandoned, and logged as failures with `context canceled`.
- Chats 1 and 2 get no deliveries: registering a webhook on either is `404`.
Disclosures:
- Judgement call: redirects are not followed, and a 3xx is logged like any other status that is not 2xx; following one can turn the POST into a GET without the message.
- Judgement call: the logged error is Go's own with the URL taken out, so it can name the webhook's host, never its path, query or credentials.
- Judgement call: the README lists the two warnings only. Encoding a message as JSON, logged as an error if it fails, cannot fail for a message the chat client sent.
Model: opus-5-5
Each message a contact sends in a direct chat is posted to each webhook
on that chat, as JSON holding `chat_id` and the message record of the
messages endpoint. The event handler only queues it: `api.Deliveries`
serves a queue of 100 with four goroutines, reads the chat's webhooks
there, and makes one POST per webhook, with a 10-second timeout, no
retry and no redirect followed. A full queue or a failed post is logged
by ids, never by URL or text. `bot.Run` stops it last, once the chat
client has exited. Tests cover the payload and its routing, a full
queue, failures, and a webhook that never answers; the README documents
the payload and what delivery promises.
Model: opus-5-5
PASS: this change posts each message a contact sends to its chat's webhooks as #7 decides, and is ready to merge into next.
Judgement call: a logged post failure can name the webhook's host, but never its path, query or credentials; accepted, since the README says so.
Model: opus-5-5
PASS: this change posts each message a contact sends to its chat's webhooks as https://git.eeqj.de/sneak/simplexcalc/issues/7 decides, and is ready to merge into `next`.
Judgement call: a logged post failure can name the webhook's host, but never its path, query or credentials; accepted, since the README says so.
Model: opus-5-5
Brings in the exact results past the range of a double. docs/TODO.md
conflicted: both Completed Steps lines are kept, the newer one first.
Model: opus-5-5
Merged next in, bringing #16; only docs/TODO.md conflicted, and both Completed Steps lines are kept, the newer one first; README.md merged on its own and keeps both changes.
Model: opus-5-5
Merged `next` in, bringing https://git.eeqj.de/sneak/simplexcalc/issues/16; only `docs/TODO.md` conflicted, and both Completed Steps lines are kept, the newer one first; `README.md` merged on its own and keeps both changes.
Model: opus-5-5
PASS: merging next into this branch keeps every change from #16 and from #7 exactly once, orders the two new Completed Steps lines by commit time (a judgement call the merge commit states), and the change is ready to merge into next.
Model: opus-5-5
PASS: merging `next` into this branch keeps every change from https://git.eeqj.de/sneak/simplexcalc/issues/16 and from https://git.eeqj.de/sneak/simplexcalc/issues/7 exactly once, orders the two new Completed Steps lines by commit time (a judgement call the merge commit states), and the change is ready to merge into `next`.
Model: opus-5-5
clawbot
merged commit fa2aa09769 into next2026-09-29 10:23:25 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Implements #7.
Each message a contact sends in a direct chat, that is each one
GET /api/v1/chats/{id}/messagesshows asreceived, is posted to each webhook on that chat:POST,Content-Type: application/json, body{"chat_id":3,"message":{...}}with the record frominternal/api/messages.go. Delivery lives ininternal/api/deliveries.go, beside the webhooks it reads. The event handler only callsDeliveries.Add, which queues the message or, with 100 already waiting, drops it and logs that; four goroutines read the chat's webhooks and make one POST to each, with a 10-second timeout and no retry. The README documents the payload, what delivery promises and both log lines.What the diff does not show:
bot.Runstops the deliveries last, once the chat client has exited, so posting goes on while the API and the chat client stop. Posts still in progress then are abandoned, and logged as failures withcontext canceled.404.Disclosures:
Model: opus-5-5
PASS: this change posts each message a contact sends to its chat's webhooks as #7 decides, and is ready to merge into
next.Judgement call: a logged post failure can name the webhook's host, but never its path, query or credentials; accepted, since the README says so.
Model: opus-5-5
Merged
nextin, bringing #16; onlydocs/TODO.mdconflicted, and both Completed Steps lines are kept, the newer one first;README.mdmerged on its own and keeps both changes.Model: opus-5-5
PASS: merging
nextinto this branch keeps every change from #16 and from #7 exactly once, orders the two new Completed Steps lines by commit time (a judgement call the merge commit states), and the change is ready to merge intonext.Model: opus-5-5