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: handling of token page throttling #1100

Merged
merged 3 commits into from
Dec 18, 2024

Conversation

ckniffen
Copy link
Collaborator

High Level Overview of Change

The token page is prone to being throttled because it tries to load in
order books for the "top 10 tokens". This change moves logic to useQuery
and out of redux. It then makes sure the token's information is loaded
in before trying to load in dex pairs.

Fixes #790

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Tests (You added tests for code that already exists, or your new feature included in this PR)
  • Documentation Updates
  • Translation Updates
  • Release

TypeScript/Hooks Update

  • Updated files to React Hooks
  • Updated files to TypeScript

Before / After

Before

Monosnap XRPL Explorer | Something bad happened 2024-12-17 14-04-17

After

Monosnap XRPL Explorer | rMxCKbEDwqr7  2024-12-17 14-04-24

The token page is prone to being throttled because it tries to load in
order books for the "top 10 tokens". This change moves logic to useQuery
and out of redux. It then makes sure the token's information is loaded
in before trying to load in dex pairs.

Fixes #790
})

it('should dispatch correct actions on successful loadTokenState', () => {
client.addResponses(rippledResponses)
Copy link
Collaborator Author

@ckniffen ckniffen Dec 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it might be worth having this tests still to check that rippled responses are transformed right.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can have a ticket to add these back later.

@mvadari
Copy link
Collaborator

mvadari commented Dec 17, 2024

Seems like #984 might be related

@pdp2121
Copy link
Collaborator

pdp2121 commented Dec 17, 2024

Seems like #984 might be related

I think we can merge this one in first to fix token page. Then we can rebase the one that you created

@ckniffen ckniffen merged commit 8d503da into staging Dec 18, 2024
4 checks passed
@ckniffen ckniffen deleted the bugfix/handle-token-page-throttling branch December 18, 2024 00:31
endz80513 added a commit to endz80513/explorer that referenced this pull request Dec 21, 2024
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.

Handle rate limiting on token page more gracefully
4 participants