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

Federated Activities should use ID instead of URL #296

Open
trwnh opened this issue Oct 29, 2018 · 0 comments
Open

Federated Activities should use ID instead of URL #296

trwnh opened this issue Oct 29, 2018 · 0 comments
Labels
A: Federation Stuff related to Federation
Milestone

Comments

@trwnh
Copy link

trwnh commented Oct 29, 2018

Ideally Mastodon would support Update activities, but there is another solution: federation permalink can be ID-based instead of title-based, and a "pretty url" can be formed from a custom slug containing the title or whatever the user enters.

So, for example, I might post an article on Plume that federates out as https://plume.example/~/trwnh/6743826481264 and the title is test post. The default pretty-url slug would be test-post (but I could edit it manually to test if I wanted to, or 2018/10/11/1, or 2018/testpost, or whatever I wanted) and then the URL would become https://plume.example/~/trwnh/test-post (or whatever i set it to)

When federating that out, you would use the id as that permalink, and url as the slugified link. So for example:

"id": "https://plume.example/~/trwnh/6743826481264",
"url": "https://plume.example/~/trwnh/test-post",

And the content of the Create activity would include the id instead of the url. So something like <p>$title - $id</p> at the simplest, and then it would show up in Mastodon like this:

trwnh (@trwnh@plume.example) posted 23s ago:
-----------------------------------------------------------------
test post - https://plume.example/~/trwnh/6743826481264
-----------------------------------------------------------------
[reply] [boost] [favorite] [menu]

or trwnh posted a new article:<br>$title<br>$id, and then it would show up in Mastodon like this:

trwnh (@trwnh@plume.example) posted 23s ago:
-------------------------------------------------------
trwnh posted a new article:
test post
https://plume.example/~/trwnh/6743826481264
-------------------------------------------------------
[reply] [boost] [favorite] [menu]

The important thing is that the URL that gets federated out cannot change, so it's a bad idea to use a value that can be changed. Not every implementation might support Update activities, so using the id is more robust and will fail in less cases.


Related: #221 #207

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: Federation Stuff related to Federation
Projects
None yet
Development

No branches or pull requests

3 participants