feat(mentions): mentioning a person finally tells them - #775
Merged
Conversation
The `mention` notification type has existed since the notification config was written. It has copy, an icon case in NotificationItem.tsx, and a place in the type union. Nothing has EVER created one. You could write @alice and she would never know — which makes the mention syntax decorative rather than social, and it has been that way the whole time. Fixing it needs exactly what the Cat already uses: notice a mention on a post, resolve it properly, act, retry on failure. So rather than build a second pipeline beside the first, the existing one widens by one word. cat_mention_queue becomes mention_queue and claim_cat_mentions becomes claim_mentions, because the Cat is one mentioned account among many and the name should say so. The prefilter widens with it — from '@cat' to '@' — since a post naming only @alice has to reach the worker too. It is still a PREFILTER and still deliberately dumb. domain/mentions/parse.ts and services/mentions/resolve.ts remain the single authority on what counts as a mention; the worker discards whatever the trigger over-selects, and marks it done rather than failed, because retrying a post that named nobody three times and then logging an error is noise about nothing. One resolve now produces both outcomes: reply if the Cat was named, and tell the people who were. Two features, one query, one definition of what a mention is. MENTIONS IN PRIVATE MESSAGES ARE DELIBERATELY NOT NOTIFIED, and that is a privacy decision rather than an omission. A participant already gets a new_message notification, so a second one for being named is noise. A NON-participant must never be told at all: the notification would disclose that a conversation exists, who is in it, and through the preview part of what was said. Typing a friend's handle in a private chat is not publishing to them. The notification quotes the post rather than sending a bare "you were mentioned", skips the author naming themselves, skips the Cat (it has no inbox), and never throws — the post is already written by then, and losing a notification must not cost the Cat's reply. Co-Authored-By: Claude Opus 5 <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.
The
mentionnotification type has existed since the notification config was written — copy, an icon case inNotificationItem.tsx, a place in the type union. Nothing has ever created one.You could write
@aliceand she would never know. That makes the mention syntax decorative rather than social, and it has been that way the whole time.Widening the pipeline instead of building a second one
Fixing it needs exactly what the Cat already uses: notice a mention on a post, resolve it properly, act, retry on failure. So the existing pipeline widens by one word.
cat_mention_queuemention_queueclaim_cat_mentionsclaim_mentions~* '@cat''@'The Cat is one mentioned account among many, and the name should say so.
It is still a prefilter and still deliberately dumb.
domain/mentions/parse.ts+services/mentions/resolve.tsremain the single authority on what counts as a mention. The worker discards what the trigger over-selects and marks it done, not failed — retrying a post that named nobody three times and then logging an error is noise about nothing.One resolve now produces both outcomes: reply if the Cat was named, and tell the people who were. Two features, one query, one definition of what a mention is.
Mentions in private messages are deliberately not notified
This is a privacy decision, not an omission:
new_messagenotification, so a second one for being named is noiseTyping a friend's handle in a private chat is not publishing to them.
Details that decide whether it's welcome or noise
Verification
npm run verify— exit 0 (2384 tests)BEGIN … ROLLBACK— table, function and trigger present in-transaction, old table restored after rollback🤖 Generated with Claude Code