···4444 name="raw",
4545 ),
4646 ),
4747+ # TODO: should be first that is not None
4748 return_when=asyncio.FIRST_COMPLETED,
4849 )
4950 return done.result()
···184185 """Returns the PDS endpoint from the DID document."""
185186186187 for service in doc.get("service", []):
187187- if service.get("id") == "#atproto_pds":
188188+ type = service.get("type")
189189+ id = service.get("id", "")
190190+ if type == "AtprotoPersonalDataServer" or id.endswith("#atproto_pds"):
188191 url = service.get("serviceEndpoint")
189192 if url is not None:
190193 return PdsUrl(url)
···204207 doc = await resolve_doc_from_did(client, did)
205208 if doc is None:
206209 return None
207207- pds = doc["service"][0]["serviceEndpoint"]
210210+ pds = pds_endpoint_from_doc(doc)
208211 if pds is None:
209212 return None
210213 kv.set(did, value=pds)