Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

=> ActivityPub: for replies, include all of the original post's mentions to generate notifications #1608

Open
sodiboo opened this issue Dec 6, 2024 · 5 comments

Comments

@sodiboo
Copy link

sodiboo commented Dec 6, 2024

Normally, on the fediverse, replies have mentions at the start of their body. When replying, there are mentions implicitly filled in when you begin authoring a reply.

These mentions are, on Sharkey (and probably others? doesn't really matter, because it is broken on at least one fedi instance type), for public posts, the only thing controlling notification delivery.

By default, Bluesky doesn't fill in mentions in the post body, but it still deliver notifications nonetheless.

When a Bluesky account, which is otherwise bridged, replies to me on the Fediverse, I get no notification. The replies are delivered to my instance, I can see them under the original post, but as I am never mentioned, I do not receive a notification.

This is essentially the inverse of #1207, as that one is about trimming replies at the start of a post when delivering to Bluesky.


I'm also somewhat surprised that there is no existing issues for this? I tried looking, but no open issues seem relevant?

@Tamschi
Copy link
Collaborator

Tamschi commented Dec 6, 2024

Hm, those should be added already, just only as tags and not as links in the post body:

bridgy-fed/activitypub.py

Lines 725 to 739 in e375b5a

# Mastodon evidently requires a Mention tag for replies to generate a
# notification to the original post's author. not required for likes,
# reposts, etc. details:
# https://github.com/snarfed/bridgy-fed/issues/34
if orig_obj:
for to in (util.get_list(orig_obj, 'attributedTo') +
util.get_list(orig_obj, 'author') +
util.get_list(orig_obj, 'actor')):
if isinstance(to, dict):
to = util.get_first(to, 'url') or to.get('id')
if to:
add(activity.setdefault('tag', []), {
'type': 'Mention',
'href': to,
})

Do you have an example of a message that didn't generate a notification?
If the mention is missing or incorrect then that's a regression in Bridgy Fed, otherwise it's an issue that should be fixed in Sharkey.

@snarfed
Copy link
Owner

snarfed commented Dec 6, 2024

@Tamschi is right. @sodiboo you're right that these @-mention "canoes" in fediverse replies are common, but they're not required by AP, and most fediverse servers still notify the original post's author without them. (Notification triggers aren't really standardized as part of AP, they're just convention right now.)

@sodiboo
Copy link
Author

sodiboo commented Dec 6, 2024

Do you have an example of a message that didn't generate a notification?

wait. what the hell what the fucking hell.

okay, so I had like 3-4 replies in mind. in particular this one by puppygirlhornypost which I ended up replying to on Bluesky because I saw it in my timeline there instead of ever receiving a notification. I would also have added this reply by my own account, but the strange thing is that I could find these on the notifications tab of my Sharkey just now?? but I swear I couldn't when they were newer. the first one also definitely has a notification out of order.

however, that second thread does have a reply that semantically I should be included in, but never did receive a notification. it's actually from Mastodon replying to a post by Bridgy Fed, which only tags my Bluesky account and never delivers a notification to fedi. it's this one by zy. That reply shouldn't deliver a notification, because the canonical way to remove someone from a thread on Mastodon-likes is to no longer mention them in the start of every post, but the reason my fediverse account was excluded from mentions is because bsky doesn't add mentions.

The post that caused me to create this issue is this one by theycallhermax which seems to have never federated? My instance can't show me that reply. I'm mutuals with the reply author, so I'd expect that to cause it to show up at least. Federation is working from Bridgy Fed => my instance, because if you look at the boats you will see @[email protected] in there. This is another reply from the same user that never showed up on my instance

My own user's posts, including replies to myself, also seem to rarely federate. This is the user page in question, as viewed from my instance. It notably includes boosts from an hour ago, but it's missing this post from 3 days ago about Rust Civilization and this thread I made to test notification delivery. This is despite me being mutuals with this account since its creation.

Any issues with my own Bluesky account are likely due to that profile being cursed in Bridgy Fed (all links on that page go to 404), but it can't be the only factor because I'm not seeing Max's replies either and her profile is fine (she can also boost but she can't meaningfully reply since they are half-broken)

I think the biggest weighing factor is the fact that mastodon mentions and replies are the same physical property, and cannot be separated. When such a user replies to a bridged post, the Fediverse instance overwrites any activitypub purism and gives you an Outright incorrect answer (of dropping the ancestor's author from the thread)

also uhh, I am sort of sleep deprived as I write this. the last paragraph was difficult to formulate in a sensible way, I apologize in advance for any troubles in comprehending it.

@snarfed
Copy link
Owner

snarfed commented Dec 6, 2024

Sorry for all the difficulties and confusion here! Lots going on, including inherent fediverse delivery inconsistency, differences between fedi software and how they each handle replies and notifications, and probably actual Bridgy Fed bugs. Sorry about those.

I think the biggest weighing factor is the fact that mastodon mentions and replies are the same physical property, and cannot be separated.

One key distinction here is between Mention tags in the underlying AS2 objects, which Mastodon does use to trigger notifications, and user-visible [@username] links in content, which it doesn't. Bridgy Fed includes the latter but not the former in its replies, and they still generate notifications in Mastodon fine.

Also, one useful thing the user-visible @-mention links in replies do is trigger notifications for all previous authors in the thread - with caveats, as you mention - not just for the immediate in-reply-to author. Bridgy Fed doesn't do that right now, so only the immediate in-reply-to author gets notified. #1218 is somewhat related here.

@snarfed
Copy link
Owner

snarfed commented Dec 6, 2024

Fwiw, I'm not really inclined to add the common user-visible @-mention link canoes to all previous authors, but I could definitely consider adding Mention tags for them to the underlying AS2 reply Notes.

@snarfed snarfed changed the title ATProto => ActivityPub: mentions aren't prefixed to replies => ActivityPub: for replies, include all of the original post's mentions to generate notifications Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants