bridgy-fed icon indicating copy to clipboard operation
bridgy-fed copied to clipboard

Refactor code for normalizing IDs

Open snarfed opened this issue 4 months ago • 0 comments

...ie converting them to the canonical representation for their protocol. http://user.com/ => user.com for web, http://instance/@user => http://instance/users/user for fediverse, https://bsky.app/profile/user => did:plc:abc for ATProto, etc.

We currently do this in ids.translate_* and ids.normalize_user_id, and a bit ad hoc elsewhere too, and we use it in Object.normalize_ids, but it's not very clean, it causes circular imports in ids, and it's not easily reusable enough elsewhere, eg for #1172.

Made a lot of progress on this in a stash, but there's still a lot of work left to do.

snarfed avatar Oct 17 '24 16:10 snarfed