social-app: Handle-based post/profile links break when handles change

So I guess there are two main URL formats for linking to posts:

handle-based

https://bsky.app/profile/<handle>/post/<rkey>

e.g.: https://bsky.app/profile/retr0.id/post/3k56fcvdn4n2c

DID-based:

https://bsky.app/profile/<did>/post/<rkey>

e.g. https://bsky.app/profile/did:plc:vwzwgnygau7ed7b7wt5ux7y2/post/3k56fcvdn4n2c

The DID-based URLs are obviously more permanent, but the handle-based ones break every time a user’s handle changes. The handle-based URLs are most commonly reachable through the web UI, and I can see why - they look nicer.

I have an idea for a solution - introducing a third new URL format! (and making it the new default - but keeping backwards-compat)

https://bsky.app/profile/<handle>~<did>/post/<rkey>

Non-working example: https://bsky.app/profile/retr0.id~did:plc:vwzwgnygau7ed7b7wt5ux7y2/post/3k56fcvdn4n2c

This has the advantage of still being human-readable (with the human part foremost), while still not breaking when handles change. It is uglier than a handle-only URL, but I suspect 99% of users remain blissfully unaware of URL aesthetics, while they certainly will notice broken links.

I chose ~ because it’s allowed in URLS, but not in handles (and maybe not DIDs? would need to triple-check that…). The app would just ignore the value of <handle>, using only the DID for lookups - but potentially you could rewrite the URL to point to the correct updated handle, if it no longer matches up (this is similar to how twitter URLs work, by the way).

Another solution I considered was a “permalink” button under the … menu, linking to the DID URL, but non-nerds would never notice it or know to use it.

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 13
  • Comments: 30 (10 by maintainers)

Most upvoted comments

Tossing out another suggestion: append dids as the last segment

Profiles

1. https://bsky.app/<handle>/<did>
2. https://bsky.app/<handle>
3. https://bsky.app/<did>

eg

1. https://bsky.app/pfrazee.com/did:plc:ragtjsm2j2vknwkz3zp4oxrd
2. https://bsky.app/pfrazee.com
3. https://bsky.app/did:plc:ragtjsm2j2vknwkz3zp4oxrd

If 2 or 3 is used, app automatically redirects to usage 1

Content

1. https://bsky.app/<handle>/<collection short name>/<rkey>/<did>
2. https://bsky.app/<handle>/<collection short name>/<rkey>
3. https://bsky.app/<did>/<collection short name>/<rkey>

eg

1. https://bsky.app/pfrazee.com/post/1234/did:plc:ragtjsm2j2vknwkz3zp4oxrd
2. https://bsky.app/pfrazee.com/post/1234
3. https://bsky.app/did:plc:ragtjsm2j2vknwkz3zp4oxrd/post/1234

If 2 or 3 is used, app automatically redirects to usage 1

Content subpages

1. https://bsky.app/<handle>/<collection short name>/<rkey>/<subpage>/<did>
2. https://bsky.app/<handle>/<collection short name>/<rkey>/<subpage>
3. https://bsky.app/<did>/<collection short name>/<rkey>/<subpage>

eg

1. https://bsky.app/pfrazee.com/post/1234/liked-by/did:plc:ragtjsm2j2vknwkz3zp4oxrd
2. https://bsky.app/pfrazee.com/post/1234/liked-by
3. https://bsky.app/did:plc:ragtjsm2j2vknwkz3zp4oxrd/post/1234/liked-by

If 2 or 3 is used, app automatically redirects to usage 1

This link is currently being shared around: https://bsky.app/profile/itch.io/post/3lcu6h465bs2n

Post contents:

I kid you not, itch.io has been taken down by Funko of “Funko Pop” because they use some trash “AI Powered” Brand Protection Software called Brand Shield that created some bogus Phishing report to our registrar, iwantmyname, who ignored our response and just disabled the domain

The irony here is that, once caches expire, that link will 404 for the reasons stated in the post itself.

I point this out because it’s yet another scenario where DIDs in the URL would improve the situation (i.e. it’s not just handle changes that could break URLs, but general DNS breakage).

Regular DID-based link for reference, in case the above one really does 404: https://bsky.app/profile/did:plc:oy37ivqnriw6nx3lrbcht2u3/post/3lcu6h465bs2n

There is some urgency here with the recent pressure around verification - actively assisting existing users to get verified by updating their handle is going to break embeds, links, etc. that are already out there; and there are some downstream effects that could be very bad as the links get out there (i.e. posts embedded in news, journalists that change organisation, etc. - these become dead links by design at the moment).

And to propose a scheme - https://bsky.app/<handle>/<did>:<collection short name>:<rkey> or similar splitting right to left - you could even jam the cid in there - I think the query strings, etc. get too complex. I don’t think the aesthetics matter that much over getting it all in without a query string, and I think it should break if you mess with it so people don’t get lulled into making ‘prettier’ urls that contain less info. This would look like https://bsky.app/bossett.social/did:plc:jfhpnnst6flqway4eaeqzj2a:post:3lcgevzrdyc2m, and you could redirect to the correct handle if it’s changed which also makes the change more discoverable.

I was just thinking about this again. One potential issue with the https://bsky.app/profile/<handle>/post/<rkey>?did=<did> format @pfrazee mentioned is that, aesthetically, it looks like a “tracking URL”. Most people probably don’t care, but for anyone in the category of “tech savvy but unaware of atproto implementation details”, they’ll think it’s superfluous information that can/should be stripped off (and if they test the stripped URL, it’ll still work for them). I do like the general idea of “gunk goes at the end”, though.

Maybe something like https://bsky.app/profile/<handle>/post/<rkey>?permalink=<did>~<cid>

Same idea, but “permalink” is a better description of what it’s there for, for non-experts. (I tacked on CID too, which could be optional, and used to check if the record has been edited)

Isn’t is possible to create a unique number based on the did:plc part so instead of doing did:plc:<something> it would be just a number that is easier to read and easier for people to understand? And a function maybe in the api that decodes and encodes this number for those who need access to the plc? I’m just suggesting something, I have no clue whether it would help or not.

@patcon as-is, setting up a “redirect account” involves a race condition, since account A has to “release” the old handle before account B can switch to it (assuming the old handle was managed by a PDS/gateway, like with *.bsky.social). A handle squatter could be watching the firehose for high-reputation handles to become available, and snag them before the legitimate redirect can be set up.

This could be solved by having a proper “handle transfer” feature in the PDS, though. But if we’re implementing new PDS features, it’d be better to just allow one account to have multiple “alias” handles at once, avoiding the need for a second account.

But, these are both solutions to a different problem, and assume a non-adversarial relationship with the original handle provider. DID-based links survive no matter what happens to the handle domain (for example, if the TLD decides to cease operations)

@callmearta That’s not impossible and doesn’t trade too much, but honestly I’d rather not add the complexity to our system.

@Bossett I think you’re right, but I can’t make that usability trade. Sometimes people need to manually craft URLs. If https://bsky.app/pfrazee.com just refused to load, I’d be pretty irritated.

I think it’s very important that at some point it breaks if you take out the did - or you are going to have people ‘prettying up’ their URLs, ‘hot tips’ that say it isn’t necessary, influencers doing ‘did you know…’ etc etc

Especially in the case of orgs that may want the style guide, and in the future may reclaim handles to put up a pinned ‘visit our main page’ post.

Seeing what other complications this may have if this pr gets added - https://github.com/bluesky-social/social-app/pull/6919

Couldn’t we keep track of profile handles that changed? Most common use case is going from something.bsky.social to something.com, and both should lead to something.com. Otherwise it opens additional risk/requirement of everyone registering two handles, which is silly.

There’s a chance that could fail in some pretty bad ways. In particular, if two users ever used the same handle, there’d be no way to know which one should “win”. I think the only reliable solution is to stuff the did in the URI somewhere; I still lean towards the QP

cc @gaearon this is that discussion

in general i think all urls that contain rkeys should instead contain did/rkey pairs. adding ?did=... to each url could be a way of doing that, but i think something more holistic would be better for the future. the url can still contain human readable elements, but ultimately the did/rkey would be what the server uses to resolve the data.

basically: https://bsky.app/profile/<handle>/post/<did>:<rkey> (doesn’t need to be colon, just illustrative)