I just tried to make a post on Mastodon and tag a community in it so that my post would show up in that community – something I’ve done many times before.

However, in this case, there is a Lemmy user with the same name as the community, and it defaulted to tagging that user. Is there a way to tag the community specifically?

I didn’t even realize that a user could have the same name as a community. I thought every fediverse actor had to have a unique at-name-at-domain handle, and both users and communities were actors.

  • Raphael@communick.news
    link
    fedilink
    English
    arrow-up
    7
    ·
    2 days ago

    I am not so sure Mastodon is at fault, here. Going to https://lemmy.world/.well-known/webfinger?resource=acct%3Avinyl%40lemmy.world, this is the result:

    {
      "subject": "acct:vinyl@lemmy.world",
      "links": [
        {
          "rel": "http://webfinger.net/rel/profile-page",
          "type": "text/html",
          "href": "https://lemmy.world/u/vinyl",
          "template": null
        },
        {
          "rel": "self",
          "type": "application/activity+json",
          "href": "https://lemmy.world/u/vinyl",
          "template": null,
          "properties": {
            "https://www.w3.org/ns/activitystreams#type": "Person"
          }
        },
        {
          "rel": "http://ostatus.org/schema/1.0/subscribe",
          "type": null,
          "href": null,
          "template": "https://lemmy.world/activitypub/externalInteraction?uri=%7Buri%7D"
        },
        {
          "rel": "http://webfinger.net/rel/profile-page",
          "type": "text/html",
          "href": "https://lemmy.world/c/vinyl",
          "template": null
        },
        {
          "rel": "self",
          "type": "application/activity+json",
          "href": "https://lemmy.world/c/vinyl",
          "template": null,
          "properties": {
            "https://www.w3.org/ns/activitystreams#type": "Group"
          }
        }
      ]
    }
    

    So, lemmy is just providing two different actors for the same subject name and saying they refer to the same account.

    • julian@activitypub.space
      link
      fedilink
      arrow-up
      3
      ·
      2 days ago

      Agreed… I didn’t respond right away since I wasn’t sure if I was right, but there are two constraints at play here:

      • Lemmy wants to allow communities to be named the same as a user
      • This is not allowed in webfinger (insomuch that multiple IDs reports should refer to the same entity)

      You can fault Mastodon for not handling it, but I think the onus is on Lemmy to adjust their behaviour.

      For reference, the same constraint happened with NodeBB. When we started, categories didn’t have handles and were not unique with users (so, a category could be named the same as a user). I needed to make the handle unique between both categories and users, for this exact reason.

      • yo_scottie_oh@lemmy.ml
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        1 day ago

        I also posted this question in another comment thread, but is there no way for an app to say “give me communities only” or “give me users only” when calling the webfinger lookup thingy? Because if there is, then Mastodon devs could update the behavior on their side to depend on whether the name starts with @ or ! (the same way Lemmy apps do).

        • julian@activitypub.space
          link
          fedilink
          arrow-up
          1
          ·
          1 day ago

          Nope, it’s just a.single route, no filters or qualifiers I am aware of.

          One could go through the returned accounts and see which are users and which are groups, although that’s expensive and time consuming to do.

      • Rimu@piefed.social
        link
        fedilink
        English
        arrow-up
        3
        ·
        1 day ago

        Regardless of how webfinger is supposed to work, Lemmy has now got a situation where there are many many overlapping actors. I don’t see a clean way out of this for them so it’ll probably persist.

        Lucky this came up because I have been meaning to make PieFed work the same as Lemmy, with multiple actors in the webfinger response!

        • julian@activitypub.space
          link
          fedilink
          arrow-up
          3
          ·
          1 day ago

          By the time it (unique handles between users and categories) was needed, NodeBB had been around for 10 years and installed in countless places.

          It needed to be done in one fell swoop so we coded an upgrade script that prioritized the user slug (as historically it had been around longer).

          Hopefully the only thing you really have to federate out is an Update, but who knows what’ll happen.

          • Rimu@piefed.social
            link
            fedilink
            English
            arrow-up
            2
            ·
            1 day ago

            https://github.com/LemmyNet/lemmy/issues/1922

            Unlikely to change. I found a more recent issue that was closed with a link going to that one, so they’ve been over this multiple times over the years and don’t want to budge.

            PieFed will continue to disallow communities and feeds to have the same name as users, that will maximize compatibility.

    • Die4Ever@retrolemmy.com
      link
      fedilink
      English
      arrow-up
      3
      ·
      2 days ago

      What if the community was the first entry in the results instead of the user? Maybe that’s more appropriate and might cause Mastodon to default to the community when there’s a conflict

      • Raphael@communick.news
        link
        fedilink
        English
        arrow-up
        2
        ·
        2 days ago

        That might work, but it’s never a good idea to write your code against a specific implementation. Plus, it seems that in this case the Lemmy devs shot themselves in the foot: why allow to create two different types of actors with the same name?!

        • Die4Ever@retrolemmy.com
          link
          fedilink
          English
          arrow-up
          2
          ·
          2 days ago

          I agree. Users shouldn’t be allowed to choose a name that already exists as a community. But it would be a shame if communities could not be created because a user with that name already exists.

          • Raphael@communick.news
            link
            fedilink
            English
            arrow-up
            3
            ·
            2 days ago

            I think this is yet-another reason to have a separation between users and communities at the instance/domain level.

            Setting up a server should require one top-level domain and two subdomains:

            • https://myserver.com/ would be for webfinger and the actual backend.
            • https://groups.myserver.com/ would be the subdomain for the AS2.Group actors
            • https://people.myserver.com/ would be the subdomain for the AS2.Person actor