Repository navigation
feat(activitypub,mastodon-api): accept EmojiReact and undo reactions - #581
Merged
Merged
Conversation
Store Pleroma/Akkoma EmojiReact like a Like, so it counts toward favourites_count and renders as a favourite notification. Handle Undo of a Like or EmojiReact (embedded or by bare id) by deleting the stored reaction, only when the Undo's actor authored it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015LRGjmHE99WESN5HBERxSj
Owner
Author
|
Automated review against CONTRIBUTING.md and the diff. Conforms: the title and commit use Conventional Commits with the right scope. The body keeps the Suggestions (none blocking):
Generated by Claude Code |
Match the reaction's actor whether stored as an IRI or an embedded
{ id } object, filter on the inbox `type` column, explain why untyped
Undo objects may try the reaction path, document that no tombstone is
kept, and split the mastodon-api changeset as a patch.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015LRGjmHE99WESN5HBERxSj
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
Inbound emoji reactions, the second of the SiliconBeest interop extensions (after inbound
Movein #579).EmojiReact(Pleroma/Akkoma) used to fall through todefaultand was dropped. It is now stored and forwarded exactly like aLike, counts towardfavourites_count, and appears as afavouritenotification. Mastodon's API has no reaction notification type, so the emoji itself isn't shown, the same downgrade Misskey makes when it sends its own reactions to Mastodon peers asLike.Undo(Like)/Undo(EmojiReact): this was a gap even for plainLike.#onUndoonly handledFollow, so un-favouriting on a remote server never removed the favourite here. AnUndonaming aLikeorEmojiReact(embedded with anid, or by bare IRI) now deletes that stored row, but only when the row'sactoris theUndo's actor (already bound to the HTTP signer, and matched whether the storedactoris an IRI or an embedded{ id }), so no one can retract someone else's reaction. A bare-IRIUndostill never touches followers, andUndo(Announce)is unchanged.Likeid within the 7-dayseendedup window is dropped, but a reaction that arrives after its ownUndo, or after that window, is stored again. The spec documents this.Not in this PR: sending
EmojiReact. The Mastodon client API has no way to request one.Packages affected
@dwk/activitypub, @dwk/mastodon-api
Checklist
spec/packages/and updated them ifbehaviour changed:
spec/packages/activitypub.md(inbound list and a reactions bullet),spec/packages/mastodon-api.md(Notification mapping)src/*.test.ts). In activitypubmastodon-api.test.ts: anEmojiReactcounts as a favourite and is notified;Undoof an embedded or bare-idLikeandEmojiReactdrops the count back to 0; a reaction stored with an embedded actor object can be undone; a forgedUndofrom another actor leaves it. In mastodon-apientities.test.ts:EmojiReactmaps to afavouritenotification.pnpm lint && pnpm format:check && pnpm typecheck && pnpm build && pnpm test(3322 passed)pnpm changeset) if this touches a publishablepackage (
minorfor activitypub,patchfor mastodon-api)catalog.json/conformance/status.jsonif this adds a newmountable worker or changes conformance status: not applicable, no new worker and no change to conformance status
🤖 Generated with Claude Code
https://claude.ai/code/session_015LRGjmHE99WESN5HBERxSj