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

ActivityPub => ATProto: handle usernames with _ and ~ chars #982

Closed
Tracked by #381
snarfed opened this issue May 1, 2024 · 12 comments
Closed
Tracked by #381

ActivityPub => ATProto: handle usernames with _ and ~ chars #982

snarfed opened this issue May 1, 2024 · 12 comments
Labels

Comments

@snarfed
Copy link
Owner

snarfed commented May 1, 2024

This is a fun one. First user with an underscore in their username signed up just now, https://me.dm/@punkscience_ns , @punkscience. (Hi Darryl! Sorry for the trouble!)

We translated the fediverse address @punkscience_ns@me.dm to the bridged Bluesky handle punkscience_ns.me.dm.ap.brid.gy and created the DNS TXT record _atproto.punkscience_ns.me.dm.ap.brid.gy, which is serving fine. PLC directory has it in https://web.plc.directory/did/did:plc:di27vbfe6wutukod4g36kovz.

However, ATProto handles don't allow the underscore character. 🤦 (Also see swicg/activitypub-webfinger#9) So, I guess we need to translate underscores to maybe dashes, and hope we don't hit a collision between eg x_y and x-y on the same instance.

@snarfed snarfed changed the title ActivityPub => ATProto: handle usernames with underscores ActivityPub => ATProto: handle usernames with _, ~ chars May 1, 2024
@snarfed snarfed changed the title ActivityPub => ATProto: handle usernames with _, ~ chars ActivityPub => ATProto: handle usernames with _ and ~ chars May 1, 2024
@snarfed
Copy link
Owner Author

snarfed commented May 1, 2024

Also need to handle tildes (~). Probably even less common, but theoretically possible.

Related: #744, #830

@snarfed
Copy link
Owner Author

snarfed commented May 2, 2024

Got another one: https://mastodon.social/users/_dmh, did:plc:desdlx43ak66lzgakb5tvyss, @dmhowcroft. (Sorry Dave!)

@dmhowcroft
Copy link

Thanks! Looking forward to seeing it resolved :)

@snarfed
Copy link
Owner Author

snarfed commented May 2, 2024

And:

@snarfed snarfed closed this as completed in 4b95d49 May 2, 2024
@snarfed snarfed reopened this May 2, 2024
@snarfed
Copy link
Owner Author

snarfed commented May 2, 2024

Implemented and deployed. Next, fixing these users ^ manually.

@snarfed
Copy link
Owner Author

snarfed commented May 3, 2024

Woo, first profile I've seen this work on! https://wetdry.world/@mary_ext => https://bsky.app/profile/mary-ext.wetdry.world.ap.brid.gy

@qazmlp
Copy link

qazmlp commented May 3, 2024

What happens now if there's a collision? Is the second user not bridged or do they just not get a friendly handle?

@snarfed
Copy link
Owner Author

snarfed commented May 3, 2024

They're not bridged.

I honestly couldn't predict if we hit that collision in a week, or a quarter, or five years, or never. I suspect closer to five years. We'll cross that bridge when we come to it.

@snarfed
Copy link
Owner Author

snarfed commented May 3, 2024

Need to do a bit more here: ATProto handles can't begin or end with -. https://mastodon.gamedev.place/users/_DenisProdan_ and https://warpday.net/users/98ftq556kb (@hirata_@warpday.net) failed this.

@dmhowcroft
Copy link

Is my underscore-initial username bridged to ATP now?

@snarfed
Copy link
Owner Author

snarfed commented May 4, 2024

@dmhowcroft sadly no, sorry, and honestly I don't yet have a plan for how to support usernames that begin or end with underscores or dashes.

@snarfed
Copy link
Owner Author

snarfed commented May 5, 2024

OK, I think we're set here. _ and ~ are converted to - except if they're at the beginning or end, where they're not supported, and that's now documented. I've filed #1005 for that.

@snarfed snarfed closed this as completed May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants