Highlights
A host application can now refuse a chat message before it is stored. Listen for the new MessageSaving event and return a contracts.Rejection, and the client gets the usual 422 validation answer for that field.
Added
events.MessageSaving(event namegolem15.chat.message.saving) fires before the write transaction when a message is sent, replied to or edited. It carries the conversation, the actor, the root message for replies, the trimmed content andOp(events.OpCreateorevents.OpUpdate;MessageIDis set on edits).contracts.Rejection{Field, Message}: return it from a listener to refuse the write. The API answers422 {"error":"Validation failed","errors":{"content":["…"]}}(or the field you name), nothing is stored, andMessageCreated/MessageUpdateddo not fire.
Changed
- Any other error a listener returns aborts the write and keeps the existing opaque 500 answer, so listener internals never reach the client.
Without a MessageSaving listener every route, payload, status and table is unchanged.