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
fix(sdk-core): ensure repository operations route to correct server (PDS/SDS)
When using OAuth to access organization repositories on SDS via repo.repo(orgDid),
operations were incorrectly routing to the user's PDS instead of the SDS server.
Root cause: Agent was created from OAuth session but only had api.xrpc.uri configured.
Without setting agent.service, it continued using session's default PDS URL.
Solution: Set both agent.service and agent.api.xrpc.uri in Repository constructor
to ensure all operations route to the specified server URL.
Affected operations:
- HypercertOperationsImpl: list(), listCollections(), get(), create()
- RecordOperationsImpl: all CRUD operations
- ProfileOperationsImpl: get(), update()
- BlobOperationsImpl: upload(), get()
Also added comprehensive PDS/SDS orchestration documentation to README covering
server types, routing mechanics, and common usage patterns.
Fixes: Repository operations on organization repos routing to user's PDS
Location: packages/sdk-core/src/repository/Repository.ts:188
fix(sdk-core): ensure repository operations route to correct server (PDS/SDS)
6
+
7
+
**Problem:**
8
+
When using OAuth authentication to access organization repositories on SDS via `repo.repo(organizationDid)`, all operations like `hypercerts.list()` and `hypercerts.listCollections()` were incorrectly routing to the user's PDS instead of the SDS server, causing "Could not find repo" errors.
9
+
10
+
**Root Cause:**
11
+
The AT Protocol Agent was created from the OAuth session but only had its `api.xrpc.uri` property configured. Without setting the Agent's `service` property, it continued using the session's default PDS URL for all requests, even when switched to organization repositories.
12
+
13
+
**Solution:**
14
+
Set both `agent.service` and `agent.api.xrpc.uri` to the specified server URL in the Repository constructor. This ensures that:
15
+
- Initial repository creation routes to the correct server (PDS or SDS)
16
+
- Repository switching via `.repo(did)` maintains the same server routing
17
+
- All operation implementations (HypercertOperationsImpl, RecordOperationsImpl, ProfileOperationsImpl, BlobOperationsImpl) now route correctly
18
+
19
+
**Documentation:**
20
+
Added comprehensive PDS/SDS orchestration explanation to README covering:
21
+
- Server type comparison and use cases
22
+
- How repository routing works internally
23
+
- Common patterns for personal vs organization hypercerts
24
+
- Key implementation details about Agent configuration
0 commit comments