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

app.bsky.actor.getProfiles reads only the first actors? #640

Closed
myConsciousness opened this issue Mar 9, 2023 · 2 comments
Closed

app.bsky.actor.getProfiles reads only the first actors? #640

myConsciousness opened this issue Mar 9, 2023 · 2 comments

Comments

@myConsciousness
Copy link
Contributor

Hi amazing developers,

I'm trying to call app.bsky.actor.getProfiles to get profile information for multiple users. However, when I called this endpoint, it seemed to only read the user ID set in the leading actors.

For example, I called the endpoint as follows:

But, the only ones returned are those of the user set to the earliest actors as shown below.

{
  "profiles": [
    {
      "did": "did:plc:iijrtk7ocored6zuziwmqq3c",
      "handle": "shinyakato.dev",
      "displayName": "Shinya Kato",
      "description": "Dart/Flutter enthusiast. The author of many Dart/Flutter packages such as twitter_api_v2, twitter_oauth2_pkce, mastodon_api and etc.\n\nYou can find me on GitHub:\nhttps://github.com/myConsciousness",
      "avatar": "https://cdn.bsky.social/imgproxy/JF97YphLyIEWfq4KJNO_ZCYm9v_zNcRj7sSB8UZrRBw/rs:fill:1000:1000:1:0/plain/bafkreidqn4z6ocv5snxuqguarboozqdusam2tehccnu23yab7g2sgv64dq@jpeg",
      "banner": "https://cdn.bsky.social/imgproxy/0ijMnNxGs3aYg9Xsb5YkfehBkZo2WRJReLgMtljXPM0/rs:fill:3000:1000:1:0/plain/bafkreiaz67sqpaacxjtbj7texvnz5tlnfpthman4kvciymxg2jc2vayd4m@jpeg",
      "followsCount": 175,
      "followersCount": 102,
      "postsCount": 73,
      "declaration": {
        "cid": "bafyreid27zk7lbis4zw5fz4podbvbs4fc5ivwji3dmrwa6zggnj4bnd57u"
      },
      "viewer": { "muted": false },
      "myState": { "muted": false },
      "creator": "did:plc:iijrtk7ocored6zuziwmqq3c",
      "indexedAt": "2023-03-07T03:00:49.705Z"
    }
  ]
}

I also tried the possibility of the actors parameter being comma or space delimited, but these approaches did not return anything. Is there a problem with the structure of the request array?

Thank you.

@devinivy
Copy link
Collaborator

devinivy commented Mar 9, 2023

The way you wrote it in your example is correct:

/xrpc/app.bsky.actor.getProfiles?actors=some.handle.dev&actors=some.other.handle.dev

If there's not a match on a given handle then it is omitted from the result set. Is it possible one of the handles you included in the actors parameter is no longer being used? That would be consistent with the intended behavior.

Another thought— a way you can test your hypothesis is by trying each actors individually and checking whether each one of them gets a result when its provided on its own. For example:

// Does this handle have a result?
/xrpc/app.bsky.actor.getProfiles?actors=some.handle.dev

// Does this other handle also have a result?
/xrpc/app.bsky.actor.getProfiles?actors=some.other.handle.dev

@myConsciousness
Copy link
Contributor Author

Hi @devinivy ,

I just tried and was able to get multiple Actors. I guess the target user changed a handle to custom domain.

It works perfectly, thanks anyway!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants