A better Rust ATProto crate

Fix DidDocument::handles always failing when parsed from MiniDoc. #7

closed opened by alephcubed.com targeting main from alephcubed.com/jacquard: did-handles

DidDocResponse::parse converts from a handle to a string like this (in MiniDoc case):

also_known_as: Some(vec![CowStr::from(mini_doc.handle)]),

This will result in a stripped handle (alephcubed.com). In it's current form, DidDocument::handles requires each handle to have an at:// prefix or it will be filtered out. These two in combination result in DidDocument::handles always returning an empty vec.

Solution: Don't require at:// prefix in DidDocument::handles.

Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:q2kmuessge635fpcnyncsdlv/sh.tangled.repo.pull/3mefuee7eie22
-1
Diff #0
-1
crates/jacquard-common/src/types/did_doc.rs
··· 103 103 .as_ref() 104 104 .map(|v| { 105 105 v.iter() 106 - .filter_map(|s| s.strip_prefix("at://")) 107 106 .filter_map(|h| Handle::new(h).ok()) 108 107 .map(|h| h.into_static()) 109 108 .collect()

History

1 round 1 comment
sign up or login to add to the discussion
alephcubed.com submitted #0
1 commit
expand
Fix DidDocument::handles always failing when parsed from MiniDoc.
expand 1 comment

note, i did merge this. rebasing some of my own local commits to accommodate seems to have confused tangled

closed without merging