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

Cursor Pagination Issue on Stellar Horizon Server v2.26.1 (also v2.28.1) #5211

Open
Hathoriel opened this issue Feb 16, 2024 · 0 comments
Open
Labels

Comments

@Hathoriel
Copy link

Hathoriel commented Feb 16, 2024

What version are you using?

We are currently using Horizon Server version 2.26.1 on our node. The public Horizon server is on version 2.28.1. Both servers have same issue.

What did you do?

We observed an issue with cursor-based pagination on our Horizon instance. For replication, you can follow these steps:

  1. Go to node's Horizon endpoint: https://horizon.stellar.org/ledgers
  2. Attempt to navigate the ledgers using cursor-based pagination in the _links.prev.href field.

An example from the public Horizon server that illustrates the expected behavior:

As you can see, it is the loop we can travel with _links.prev.href infinitely.

This wrong cursor pagination is available on all endpoints, not only on /ledgers.

What did you expect to see?

We expected the cursor pagination to allow us to navigate back to the previous ledger records accurately.

What did you see instead?

The cursor does not correctly navigate to the previous records. Specifically, when trying to go back using the links.prev.href from a desc order page, it does not return to the correct previous page. Instead, it goes back to the starting point or does not navigate correctly through the ledger records.

On the public - https://horizon.stellar.org/ is version 2.28.1
On our node is version 2.26.1 https://01-gravelines-068-02.rpc.tatum.io/

The cursor is not working as expected. When I am here:
https://horizon.stellar.org/ledgers?cursor=216445057270546432&limit=10&order=asc
And I click here: https://horizon.stellar.org/ledgers?cursor=216445061565513728&limit=10&order=desc
And then again, I click on the links.prev.href, I get: https://horizon.stellar.org/ledgers?cursor=216445057270546432&limit=10&order=asc
But it should give me the previous ledger.

@Hathoriel Hathoriel added the bug label Feb 16, 2024
@Hathoriel Hathoriel changed the title Cursor Pagination Issue on Stellar Horizon Server v2.26.1 Cursor Pagination Issue on Stellar Horizon Server v2.26.1 (also v2.28.1) Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants
@Hathoriel and others