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: symbols pagination #506 #526

Merged
merged 1 commit into from
Oct 11, 2022

Conversation

habibalkhabbaz
Copy link
Contributor

@habibalkhabbaz habibalkhabbaz commented Oct 10, 2022

Description

Let's say we are monitoring 5 symbols and we add one more symbol to our Global Settings.
The bot will cache it to trailing-trade-cache collection in our Mongo DB as usual and this symbol will show up in the frontend as expected.

  • Symbols in Global Settings: 6
  • Symbols cached in DB: 6

However, when we remove that symbol from the Global Settings, the symbols count will be different than the cached symbols in our database.

  • Symbols in Global Settings: 5
  • Symbols cached in DB: 6

This is still expected but the pagination will have an issue when we reached like:

  • Symbols in Global Settings: 12
  • Symbols cached in DB: 13

Hence, we can see only the first 12 symbols from the frontend and we will not be able to see the symbol number 13 because we were paginating our symbols based on the count of symbols that exists in Global Settings.

The correct behavior is to count the symbols from the trailing-trade-cache collection which is addressed by this PR.

I also added an explanation for that when the count becomes different just to be clear.

Related Issue

#506

Motivation and Context

How Has This Been Tested?

Tests provided

Screenshots (if appropriate):

@chrisleekr chrisleekr added the bug Something isn't working label Oct 11, 2022
@chrisleekr chrisleekr linked an issue Oct 11, 2022 that may be closed by this pull request
@chrisleekr
Copy link
Owner

Hi @habibalkhabbaz

As always, your contribution is very good and clean.

I merge in.

@chrisleekr chrisleekr merged commit aba1c14 into chrisleekr:master Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pagination not working after deleting symbols
2 participants