You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lukehmcc opened this issue
Aug 26, 2024
· 0 comments
Assignees
Labels
featA label indicating that this issue is a new feature.help wantedExtra attention is neededuntriagedA label Indicating this Issue has not yet been initiated.
Currently with the atproto.repo.getRecord endpoint, the service is hard coded to your PDS (set by the ServiceContext in the repo service). This is a problem because this means that with this library you can only fetch content records from your own user's PDS. Content records are a valuable way to share information between users, and only being able to fetch from your own PDS is limiting. I propose that getRecord should dynamically resolve the PDS based on the DID fed to it.
Currently code that does this looks something like:
// Have to swap out the service to the other user's pdsfinal plcClient =PLC();
final didDoc =await plcClient.findDocument(
did: covalent2.session!.did,
);
final pds =Uri.parse(didDoc.data.service.first.serviceEndpoint).host;
final response =await xrpc.query<String>(
xrpc.NSID.create('atproto.com', 'repo.getRecord'),
service: pds, // This represents the service URL (pds).
parameters: {
'repo': covalent2.session!.did,
'collection':'app.vup.chat.test',
'rkey':'default',
},
);
if (response.status.equalsByCode(200)) {
print(jsonDecode(response.data)["value"]["text"]);
} else {
print("error fetching content record");
}
Risks
It would add more complexity.
The text was updated successfully, but these errors were encountered:
featA label indicating that this issue is a new feature.help wantedExtra attention is neededuntriagedA label Indicating this Issue has not yet been initiated.
Proposal
Currently with the
atproto.repo.getRecord
endpoint, the service is hard coded to your PDS (set by theServiceContext
in the repo service). This is a problem because this means that with this library you can only fetch content records from your own user's PDS. Content records are a valuable way to share information between users, and only being able to fetch from your own PDS is limiting. I propose thatgetRecord
should dynamically resolve the PDS based on the DID fed to it.Currently code that does this looks something like:
Risks
It would add more complexity.
The text was updated successfully, but these errors were encountered: