question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

claim_list_by_channel API returns inconsistent results

See original GitHub issue

The Issue

The claim_list_by_channel api call returns inconsistent results. If I call it with only a URI then it returns a single value like this:

{
  "id": null,
  "jsonrpc": "2.0",
  "result": {
    "lbry://@OTR": {
      "claims_in_channel": 94
    }
  }
}

However, if I request a specific page I get the same value, claims_in_channel, but now it’s a completely different type (a list of Claims). I don’t see the benefit in having this return the number of claims (there is another API, resolve, that returns the number of claims when passed a channel URI). This API should either return the first page of results (if no page was specified), or make the page parameter required.

The change of type doesn’t help the caller to know why the results aren’t as expected, the documentation mentions both types for claims_in_channel without indicating when the number version will be returned, and the integer return does not match the name of the API call (which specifically has “list” in the title).

It would be useful information in the normal return to say how many total items there are. This would give a UI a way to create a page select list (total number / page size == number of total pages). The API could return a “total_number_of_claims” or “total_claims_in_channel” value. I also think the name of this value should match the one returned by the resolve API.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kauffjcommented, Sep 25, 2018

Hey @42degrees, you’ve been digging in quite a bit recently. Good stuff!

@tzarebczan probably already linked this but we’d be happy to send you some LBC for your contributions.

Have you thought about contributing yourself? You can also email me at jeremy@lbry.io. Cheers!

0reactions
alyssaoccommented, Mar 20, 2019

closing, reopen if needed

Read more comments on GitHub >

github_iconTop Results From Across the Web

searching github api is returning inconsistent results
answer is here: get the top 10 javascript/opensource repositories ranked by star using GitHub GraphQL Api. it has to do with github limiting ......
Read more >
Inconsistent results when querying a server with requests.post ...
If I run this in Python 3, I get a different response. I checked the request body being sent to the server, and...
Read more >
Searching on Stack Overflow and using the API give different ...
Searches a site for any questions which fit the given criteria. and. This method returns a list of questions. Your example Stack Overflow...
Read more >
Best practices for REST API design - Stack Overflow Blog
Learn how to design REST APIs to be easy to understand for anyone, ... Once we have done that, we return the results...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found