Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

graph getRelationships does not behave as lexicon says it should #2919

Open
blowdart opened this issue Oct 28, 2024 · 4 comments
Open

graph getRelationships does not behave as lexicon says it should #2919

blowdart opened this issue Oct 28, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@blowdart
Copy link

blowdart commented Oct 28, 2024

Describe the bug

The lexicon for getRelationships states that at-identifers can be used in the query for both actor and others, and that the response will return dids as the actor.

This is not true :)

(it also states others is optional, probably not what you intend either)

To Reproduce

Steps to reproduce the behavior:

  1. Craft a request to getRelationships with a handle for actor, and an array of handles for others.

  2. Examine the response.

{
    "actor": "did:plc:ec72yg6n2sydzjvtovvdlxrk",
    "relationships": [
        {
            "$type": "app.bsky.graph.defs#relationship",
            "did": "blowdart.me"
        }
    ]
}
  1. Note the return structure, the did property is not a did, it's a handle. If you specify more than one handle in the others parameter you will see them reflected back in did properties.

  2. If you send either a handle that does not exist/resolve or a DID that does not exist then you still get a relationship back and not the notFoundActor as the lexicon describes.

Expected behavior

If I send handles I expect them work as handles, be reflected as handles coming back in the response with the relationships mapped and returned.

I expect non-resolvable handles, or non-existent dids sent in others to be returned as ActorNotFound

@blowdart blowdart added the bug Something isn't working label Oct 28, 2024
@RLesser
Copy link

RLesser commented Nov 11, 2024

Is this a bug in the lexicon specification here, or in the underlying bluesky server that composes the response? I'm wondering if this is even fixable from a pull request or if someone internal to bluesky/atproto needs to fix it.

@blowdart
Copy link
Author

As a starting I don't think it's clear what it's supposed to be in the lexicon, and until that's set in stone the api can't conform 🤷‍♂️

To my mind it makes sense for the api to accept at-identifers, and return at-identifers, not dids, so the lexicon is wrong.

@RLesser
Copy link

RLesser commented Nov 17, 2024

For future reference - the endpoint does work if both the actor and others are provided as dids. I didn't realize this at first so it might be helpful to others.

@blowdart
Copy link
Author

Now I switched to just DIDs it does appear to semi work but

If I pass in a did in others which is followed by the current user and also follows the current user, it only populates followedBy, not following in the resulting relationship object,

Additionally if I pass in a DID that doesn't resolve I don't get back the promised app.bsky.graph.defs.notFoundActor - it just doesn't appear in the resulting return array at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants