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

Fix resetting skip variable when loading pools from Balancer API #515

Merged
merged 1 commit into from
Aug 10, 2023

Conversation

timjrobinson
Copy link
Contributor

The skip value is used in two ways: To keep track of where in the cache the frontend has loaded up to when repeatedly loading from the cache, or to track where in the API it's up to if loading from the API.

There was a bug where when reading from the API it would call the read from cache at the end and this would reset the skip variable to the end of the cache instead of the end of the API list. This meant that when returning a filtered list of items from the API it would request say 1000 items, but only get 90 (because of the filter), then it would set set the skip for next time to 1000 (the total requested) when the skip should have actually been 90.

This fixes that bug by only resetting the skip variable to the requested skip amount when fetching from the cache. It keeps the skip set to the total retrieved from the API when results have come from the API.

The skip value is used in two ways: To keep track of where in the
  cache the frontend has loaded up to when repeatedly loading from the
cache, or to track where in the API it's up to if loading from the API.

There was a bug where when reading from the API it would call the read
from cache at the end and this would reset the skip variable to the end
of the cache instead of the end of the API list. This meant that when
returning a filtered list of items from the API it would request say
1000 items, but only get 90 (because of the filter), then it would set
set the skip for next time to 1000 (the total requested) when the skip
should have actually been 90.

This fixes that bug by only resetting the skip variable to the requested
skip amount when fetching from the cache. It keeps the skip set to the
total retrieved from the API when results have come from the API.
@johngrantuk johngrantuk merged commit 8ef236f into develop Aug 10, 2023
3 checks passed
@johngrantuk johngrantuk deleted the fix-balancer-api-skipping branch August 10, 2023 10:30
@johngrantuk johngrantuk mentioned this pull request Aug 25, 2023
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.

2 participants