Skip to content

[Bug]: com.atproto.repo.getRecord is pinned to self.pdsURL (no per-call pdsURL) #318

Description

@KC-2001MS

Summary

getRepositoryRecord(...) (ComAtprotoRepoGetRecordMethod.swift) builds its request from self.pdsURL and has no per-call pdsURL parameter, so it always queries self.pdsURL regardless of which host actually holds the target record. When self.pdsURL is an AppView (e.g. https://public.api.bsky.app) rather than the repo's PDS, records the AppView does not index return RecordNotFound — this includes the session user's own records when their PDS is outside that AppView's network. #296 added a pdsURL parameter to the sibling methods describeRepository / listRecords, but getRecord was left out.

Reproduction Steps

  1. Configure ATProtoKit with pdsURL = https://public.api.bsky.app (an AppView).
  2. Call getRepositoryRecord(from: did, collection: "app.bsky.actor.profile", recordKey: "self") for a did the AppView does not index (e.g. an account on a non-Bluesky PDS such as eurosky.social; the session user's own DID works).
  3. The request goes to self.pdsURL, which does not hold the record, and fails with RecordNotFound even though it exists at the actor's own PDS.

Expected Results

getRepositoryRecord accepts an optional pdsURL and follows the same precedence #296 introduced for describeRepository / listRecords (explicit pdsURL → DID resolution → existing host), so a record can be read from the actor's own PDS.

Actual Results

ComAtprotoRepoGetRecordMethod.swift builds the URL from self.pdsURL with no override:

guard let requestURL = URL(string: "\(self.pdsURL)/xrpc/com.atproto.repo.getRecord") else { ... }

describeRepository / listRecords got resolvePDSHost / pdsURL in #296; getRecord (same com.atproto.repo.* namespace) was not updated.

What operating systems did you experience this bug?

macOS

Operating System Version

  • macOS Tahoe 26.5.2
  • iOS 26.5.2

ATProtoKit Version

0.33.3

Additional Context

Suggested fix: the core change is routing the host through resolvePDSHost(for: repository) (added in #296) instead of the hard-coded self.pdsURL; the repository DID is already a parameter, so callers need no change. The pdsURL parameter itself is optional — it only mirrors describeRepository / listRecords for API consistency and lets a caller skip resolution when the host is already known. resolvePDSHost(for:) and ATBuiltInIdentityResolver already exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions