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

Distinguish uri and url of remote posts #459

Open
tesaguri opened this issue Dec 18, 2023 · 0 comments
Open

Distinguish uri and url of remote posts #459

tesaguri opened this issue Dec 18, 2023 · 0 comments

Comments

@tesaguri
Copy link
Contributor

tesaguri commented Dec 18, 2023

The Mastodon API has two similarly-named attributes, which are used for different purposes:

  • uri: URI of the Activity Streams object associated with the API entity (id in Activity Vocabulary)
  • url: URL of a human-readable HTML representation of the API entity (url property of Activity Vocabulary)

The Account entity has only the url attribute (though the upstream might add the uri attribute someday. cf. mastodon/mastodon#17030) and the Status entity has both the uri and url attributes.

Currently, Kitsune uses the Activity Streams URI of incoming objects for both of the attributes, even though they are not guaranteed to match in general. For example, the Activity Streams representation of Gargron's first post looks like the following:

{
  // …
  "id": "https://mastodon.social/users/Gargron/statuses/1",
  "url": "https://mastodon.social/@Gargron/1",
  // …
}

(Usually though, they are interchangeable in practice, given proper content negotiations.)

I expect fixing this would be fairly easy (just making the database store both the properties separately and making the Mastodon mapper set them separately), but I'm not working on a patch just yet since the database restructure (#458) is underway.

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

1 participant