Skip to content

Commit 3dfaf35

Browse files
committed
fix(sdk-core): configure Agent to use correct service URL for SDS queries
The Agent was using the default PDS service URL from the OAuth session even when querying SDS repositories, causing 'Could not find repo' errors. This configures the Agent's XRPC URI to use the specified server URL (PDS or SDS) so queries are routed to the correct service endpoint. - Set agent.api.xrpc.uri to the serverUrl in Repository constructor - Ensures SDS repository queries reach the SDS server - Resolves 400 errors when listing hypercerts/collections from organizations - All 317 tests passing Fixes 'Could not find repo' errors when querying shared repositories.
1 parent bcde5fa commit 3dfaf35

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hypercerts-org/sdk-core": patch
3+
---
4+
5+
Fix Agent service URL configuration to ensure queries are routed to the correct server (PDS or SDS). The Agent now explicitly uses the serverUrl provided to the Repository constructor, resolving "Could not find repo" errors when querying SDS repositories.

.changeset/pagination-and-react-hooks-fix.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ Add pagination support and fix React hooks for SDS operations
1717
**Bug Fixes (sdk-core):**
1818
- Fix permissions parsing in `CollaboratorOperationsImpl.list()` to match actual SDS API format (object with boolean flags)
1919
- Prevent `TypeError: permissionArray.includes is not a function` by correctly handling permissions as objects
20+
- Fix Agent service URL configuration to route queries to the correct server (PDS or SDS)
21+
- Resolve "Could not find repo" errors when querying SDS repositories by ensuring Agent uses SDS service endpoint
2022
- Update test mocks to use the actual SDS API response format
2123

2224
**Bug Fixes (sdk-react):**

packages/sdk-core/src/repository/Repository.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@ export class Repository {
181181

182182
// Create Agent with OAuth session
183183
this.agent = new Agent(session);
184+
185+
// Configure Agent to use the specified server URL (PDS or SDS)
186+
// This ensures queries are routed to the correct server
187+
this.agent.api.xrpc.uri = new URL(serverUrl);
188+
184189
this.lexiconRegistry.addToAgent(this.agent);
185190

186191
// Register hypercert lexicons

0 commit comments

Comments
 (0)