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.

View all comments ➔
  • 2 months

    In webfinger, the sidecar protocol we use to look up actors, lemmy does distinguish between community and user actors. Mastodon needs to up their game.

    • 2 months

      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:[email protected]",
        "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.

      • 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.

      • 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

        • 2 months

          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?!

          • 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.

            • 2 months

              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
              • 2 months

                This would make instance creation too complicated.

                • 2 months

                  It could be an optional feature.

                  By default, users and communities share the namespace so they can not have the same name. But if you as an admin want to let users and communities with the same handle (the “as:preferredUsername”), then you need to add two CNAMEs that point to the same domain of the backend, and add these to lemmy.hjson, so that the backend can know how to generate actor ids.

                  Of course, this still wouldn’t let mastodon users to find the actors by querying “username@myserver”, but at least they would be able to know they can find “@[email protected]” and @[email protected]".

        • 2 months

          Its intentionally in this order because Mastodon prioritizes the last item (ie the community). If the order was changed, it would be impossible for Mastodon users to interact with a community where a user with the same name exists.

    • 2 months

      That’s interesting, I’ll try to learn more about that.

      So, in this case, the community I was trying to post to was [email protected]. There is also a user with that name on lemmy.world. If I search “[email protected]” on Mastodon, does that mean both of them should show up? And what would their names be? One would start with ! and the other start with @?

      • 2 months

        Mastodon does not support using ! so it’s not going to work, sorry.