Conversation
Requires fmsgd's msg.is_terminal column (markmnl/fmsgd#43). - Message objects gain `terminal` (settable on create/update), `reaction` (the emoji a message carries when it is a reaction, "" for a clearing one, null otherwise) and `reactions` (effective reactions on the message: each participant's latest by time, ties by message hash, grouped by emoji). - A reaction is recognised by its FMSG-005 shape: a reply with no_reply and terminal set, not important, no add-to, type text/plain;charset=UTF-8, no attachments, body a single emoji or empty. - POST /fmsg/:id/react sets or clears the caller's reaction by sending a reaction message to every other participant in one step; idempotent when the reaction is unchanged; same reply-domain check as send. - Replies to a terminal message and add-to on one are refused with 409 before the database trigger would. - WebSocket: an arriving reaction is pushed as a `reaction` event carrying the refreshed subject, never as new_msg; no Web Push. - New internal/emoji package: RGI_Emoji set and emoji property tables generated from Unicode 17.0 data (go run ./internal/emoji/gen), with IsRGI, IsPossible (UTS #51 possible_emoji, emoji presentation required) and IsSingle. - README documents the route, fields and event. Verified: go test ./... passes; the new SQL was executed against fmsgd's v0.6.0 schema in a scratch PostgreSQL, including the trigger refusing a reply to a reaction. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MW4FXDGacoWXeKPU5cQTHS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements FMSG-005 Reactions and exposes the fmsg Specification v0.6.0 terminal flag. Requires fmsgd's
msg.is_terminalcolumn from markmnl/fmsgd#43.Message objects
terminal: the fmsg terminal flag, settable onPOST /fmsgandPUT /fmsg/:id.reaction: the emoji a message carries when it is a reaction (""for a clearing reaction),nullotherwise, so clients can hide reaction messages from lists.reactions: effective reactions on the message. Each participant's latest reaction by time, ties broken by message hash, grouped by emoji in order of first reaction.Recognition is by FMSG-005 shape: a reply with
no_replyandterminalset, not important, no add-to, typetext/plain;charset=UTF-8, no attachments, body a single emoji or empty. No dedicated media type.POST /fmsg/:id/reactsets or clears the caller's reaction by creating and sending a reaction message to every other participant in one transaction. Idempotent when the reaction is unchanged. Applies the same reply-domain check as send. Local recipients get their delivery resolved as send does.Terminal enforcement at the API: a reply to a terminal message (create/update) and add-to on one return
409with a clear message rather than surfacing the database trigger error.WebSocket and push: an arriving reaction is routed as a
reactionevent carrying the refreshed subject message, never asnew_msg, and produces no Web Push.internal/emoji:IsRGI(exact RGI_Emoji membership),IsPossible(UTS #51 possible_emoji grammar with emoji presentation required) andIsSingle. Tables generated from Unicode 17.0 bygo run ./internal/emoji/gen, which downloads the latest data by default.Thread routes are unaffected: they walk ancestors, and reactions are leaves.
terminalis added to thread message objects.Verification
go build,go vet,go test ./...pass, with new tests for shape recognition, data reading, effective-reaction reduction (change, clear, case-insensitive reactor, hash tie-break), recipient derivation, and hub routing of reactions to the subject.loadReactionRows,reactionSubject, list selects) was executed against fmsgd's v0.6.0dd.sqlplus this repo'sdd.sqlin a scratch PostgreSQL 16, and the schema trigger refused a reply to the reaction.Docs
POST /fmsgandPUTfields and errors, message object fields, new react section, add-to409, WebSocket event table.Follow-ups
dd.sqlcopy once fmsgd#43 merges.🤖 Generated with Claude Code
https://claude.ai/code/session_01MW4FXDGacoWXeKPU5cQTHS