Skip to content

Conversation

@catalyst17
Copy link
Contributor

@catalyst17 catalyst17 commented Mar 31, 2025

TL;DR

Fixed pagination offset calculation in token balances query.

What changed?

Modified the offset calculation in the GetTokenBalances method to use qf.Page * qf.Limit instead of (qf.Page - 1) * qf.Limit. This changes how pagination works when retrieving token balances from the ClickHouse database.

How to test?

  1. Query token balances with pagination parameters (page > 0, limit > 0)
  2. Verify that the correct records are returned for each page
  3. Check that there is no overlap or gap between consecutive pages

Why make this change?

The previous calculation assumed page numbers started at 1, but params in insight-service use pages starting with 0. This fix ensures that the correct offset is calculated when paginating through token balances, preventing duplicate records or skipped entries when navigating through pages.

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@catalyst17 catalyst17 requested a review from a team March 31, 2025 18:24
@catalyst17 catalyst17 marked this pull request as ready for review March 31, 2025 18:24
@catalyst17 catalyst17 merged commit f7f74cd into main Mar 31, 2025
5 checks passed
@catalyst17 catalyst17 deleted the fix/paging branch March 31, 2025 19:03
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

Successfully merging this pull request may close these issues.

3 participants