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

If multiple persons use the same name, they get each other's notifications. #538

Open
TheVillageGuy opened this issue Feb 28, 2024 · 13 comments
Labels
backend Backend related issues and pull requests bug Something isn't working
Milestone

Comments

@TheVillageGuy
Copy link
Contributor

TheVillageGuy commented Feb 28, 2024

People can register with the same name on multiple instances. If multiple persons use the same name, they get each other's notifications

@TheVillageGuy TheVillageGuy added the bug Something isn't working label Feb 28, 2024
@TheVillageGuy TheVillageGuy changed the title If multiple persons use the same name, they get each others notifications. If multiple persons use the same name, they get each other's notifications. Feb 28, 2024
@BentiGorlich
Copy link
Member

A clarification: if I BentiGorlich@gehirneimer.de get mentioned by someone and my second instance thebrainbin.org gets this post too, then my BentiGorlich@thebrainbin.org will get a mentioned notification as well. So the bug is in the recognition of the mentions

@BentiGorlich BentiGorlich added the backend Backend related issues and pull requests label Feb 29, 2024
@e-five256
Copy link
Member

Do you think this is a bug or a feature? Not to say it doesn't potentially need changes, but if I recall correctly the idea was that some people found this useful because they had many alts with the same name on different instances. I guess is the solution it should be completely removed and 1 to 1, or maybe opt-in where you can add additional usernames to notify on? Perhaps that's too complex/non-performant though

@TheVillageGuy
Copy link
Contributor Author

TheVillageGuy commented Mar 14, 2024 via email

@BentiGorlich
Copy link
Member

Its a bug for sure because we parse mentions very weird

@BentiGorlich
Copy link
Member

Ok, I am kinda hesitating to continue here. The Problem is not as big as I thought and I am not sure that it needs fixing.
If I write the following post:

look at @BentiGorlich@gehirneimer.de he is something

Only exactly that one account would get a notification. However if I write

look at @BentiGorlich he is something

Then all mbin instances will notify a local user BentiGorlich if such a user exists. @TheVillageGuy what do you think about it?

@TheVillageGuy
Copy link
Contributor Author

TheVillageGuy commented Mar 17, 2024 via email

@e-five256
Copy link
Member

I think the problem Benti is trying to express is that it's impossible for mbin to assume intent when it isn't given by the user.

A better example would be going into an auditorium and shouting "John" and everyone named "John" turning to look. Benti is saying that if you instead shout "John Smith", only one person would look (get notified), but if someone just yells "John", there's no way for the room to know who they actually meant.

I think part of this may be related to #592 and that if autocomplete existed, and perhaps was weighted to names already appearing in the thread, people would be more likely to use mentions with instance names so their intent is known.

@BentiGorlich
Copy link
Member

I think there are 3 options how to handle this:

  1. The way we do it now: just notify every person with the username
  2. Assume that a local person was meant, so don't notify anyone but the local user (local as in: from the same instance from which the post originated)
  3. Don't notify anyone because it is not a valid AP Handle / Webfinger

I don't know which of those would be the most correct one, but I would lean towards the 2nd.

@TheVillageGuy
Copy link
Contributor Author

TheVillageGuy commented Mar 17, 2024 via email

@chris-y
Copy link

chris-y commented Mar 30, 2024

It's definitely a bug. Anybody who mentions a chris on any instance, Mbin notifies me of once it picks up the message:

Screenshot_20240330-093035-974

Why do I want a notification that somebody has replied to a post that a random chris has made?
Screenshot_20240330-093300-848

It seems that Mbin is dropping the domain and assuming the user is local.

This is the same issue I raised against Kbin: https://codeberg.org/Kbin/kbin-core/issues/597

@e-five256
Copy link
Member

e-five256 commented Mar 30, 2024

Earlier in this thread it was said that it isn't dropping the domain. If it's specified it uses it, and if it's not then it assumes a local user. That seems to be mistaken based on what you showed.

Perhaps something is going wrong with posts from mastodon specifically, and not threads from lemmy/mbin (can you confirm that all the mistaken mentions were from mastodon (posts) and not entries (threads?)? Grabbing the last post in that list

  "content": "<p><span class=\"h-card\" translate=\"no\"><a href=\"https://ichidan.io/@chris\" class=\"u-url mention\">@<span>chris</span></a></span> <span class=\"h-card\" translate=\"no\"><a href=\"https://fosstodon.org/@dogphilosopher\" class=\"u-url mention\">@<span>dogphilosopher</span></a></span> <span class=\"h-card\" translate=\"no\"><a href=\"https://mastodon.sdf.org/@kylegospo\" class=\"u-url mention\">@<span>kylegospo</span></a></span> Oh man now I really have FOMO!!!!!</p>",
  "contentMap": {
    "en": "<p><span class=\"h-card\" translate=\"no\"><a href=\"https://ichidan.io/@chris\" class=\"u-url mention\">@<span>chris</span></a></span> <span class=\"h-card\" translate=\"no\"><a href=\"https://fosstodon.org/@dogphilosopher\" class=\"u-url mention\">@<span>dogphilosopher</span></a></span> <span class=\"h-card\" translate=\"no\"><a href=\"https://mastodon.sdf.org/@kylegospo\" class=\"u-url mention\">@<span>kylegospo</span></a></span> Oh man now I really have FOMO!!!!!</p>"
  },
  "attachment": [],
  "tag": [
    {
      "type": "Mention",
      "href": "https://ichidan.io/users/chris",
      "name": "@chris@ichidan.io"
    },
    {
      "type": "Mention",
      "href": "https://fosstodon.org/users/dogphilosopher",
      "name": "@dogphilosopher@fosstodon.org"
    },
    {
      "type": "Mention",
      "href": "https://mastodon.sdf.org/users/kylegospo",
      "name": "@kylegospo@mastodon.sdf.org"
    }
  ],

What I notice about this: No source field and no mediaType markdown which would be preferred, it's all raw html. The text comes out as @<span>chris</span> without the domain which seems like it is what's being used, not sure if the link is being stripped or ignored.

@BentiGorlich
Copy link
Member

maybe we should use the tagged mentions if there are any and if not we parse it ourselves?

@BentiGorlich BentiGorlich added this to the v1.6.0 milestone Apr 8, 2024
@e-five256
Copy link
Member

e-five256 commented Apr 10, 2024

I had to try to reverse engineer what is going on so it took me a bit, if anything is wrong, feel free to correct me.

It looks like the code for who to notify is here

public function extract(?string $val, $type = self::ALL): ?array

That gets called from entry/entrycomment/post/postcomment. Taking post as an example

$mentions = MentionManager::clearLocal($this->mentionManager->extract($subject->body));

It looks like this extracts who to notify from the body


If the above is correct, then I 100% agree with you Benti, we should not be relying on parsing the body, we should use the tag field which appears to have the exact information on who was Mentioned

I did a quick parse of AP events and what I see is, obviously mastodon uses it as above. We set it on at least entry comments and posts, and lemmy sets it on entry comments. What I notice about us vs lemmy is that we add the parents, whereas lemmy might not? I took one example of a reply to a reply and the tag field only contained one actor, the person they were replying to. Whereas we seem to include all the way up the chain. I could be mistaken, but this might be something to keep in mind were we to change it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Backend related issues and pull requests bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

4 participants