Skip to content

Allow resolving lexicons from locations other than the network #5

@tom-sherman

Description

@tom-sherman

Right now Node.resolve() is coupled to the network because it always calls com.atproto.repo.getRecord on the PDS. This should be customisable to allow for resolving from a local fs-based cache, database, or in memory (useful for testing).

This is kinda possible by injecting your own fetch implementation but it's annoying to work with, a better interface would be ideal here. Something like (did, nsid, cid?) => Promise<doc>.

There's an open question about what you do with authority resolution. We want the ability to swap this out in a similar way, at least for testing and caching. But sometimes we probably want to ensure that the authority has been fetched, maybe even on a lexicon-by-lexicon basis (not globally for the whole program). So maybe the above signature becomes (authority, nsid, cid?) => Promise<doc>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions