feat: store structured reaction data (reaction_to_id, reaction_emoji)#67
Open
vlassance wants to merge 1 commit intosteipete:mainfrom
Open
feat: store structured reaction data (reaction_to_id, reaction_emoji)#67vlassance wants to merge 1 commit intosteipete:mainfrom
vlassance wants to merge 1 commit intosteipete:mainfrom
Conversation
Add reaction_to_id and reaction_emoji columns to the messages table via migration v4. This stores structured reaction metadata alongside the existing display_text approach, enabling programmatic access to reaction data (e.g., which message was reacted to, and with what emoji). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
reaction_to_idandreaction_emojicolumns to the messages table via migration v4UpsertMessageParamsand into the databasedisplay_textapproach from PR Add display text for reactions, replies, media types #5 with machine-readable reaction dataProblem
PR #5 added
display_textfor reactions (e.g., "Reacted 👍 to hello"), which is great for human-readable output. However, there is no way to programmatically query which message a reaction targets or what emoji was used. This makes it difficult to build downstream tools that need to process reactions (e.g., counting reactions, filtering by emoji).Solution
Store the raw
reaction_to_id(stanza ID of the message being reacted to) andreaction_emoji(the emoji text) as separate columns. These are populated from the existingParsedMessage.ReactionToIDandParsedMessage.ReactionEmojifields that are already parsed by thewapackage.Testing
go test ./...— all tests passgo build ./...— builds cleanly