Skip to content

fix: handling of token page throttling#1100

Merged
ckniffen merged 3 commits intostagingfrom
bugfix/handle-token-page-throttling
Dec 18, 2024
Merged

fix: handling of token page throttling#1100
ckniffen merged 3 commits intostagingfrom
bugfix/handle-token-page-throttling

Conversation

@ckniffen
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Collaborator

mvadari commented Dec 17, 2024

Seems like #984 might be related

@pdp2121
Copy link
Copy Markdown
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
@ckniffen ckniffen deleted the bugfix/handle-token-page-throttling branch December 18, 2024 00:31
@mvadari mvadari mentioned this pull request Dec 18, 2024
1 task
endz80513 added a commit to endz80513/explorer that referenced this pull request Dec 21, 2024
achowdhry-ripple added a commit that referenced this pull request Apr 8, 2025
## High Level Overview of Change

This PR removes the last of redux from the codebase. The only two pieces
left were Account and Token.

It also removes all mentions of gravatars.

This also reduces the size of the build by about 35kb.

There were some build issues that required regenerating the
package-lock, which is almost all of the diff.

### Context of Change

* #649
* #640
* #635
* #634
* #1100

### Type of Change

- [x] Refactor (non-breaking change that only restructures code)

### TypeScript/Hooks Update

N/A

## Test Plan

Tests were fixed to handle the refactor.

---------

Co-authored-by: Ashray Chowdhry <achowdhry@ripple.com>
heap-coder added a commit to heap-coder/explorer that referenced this pull request Sep 27, 2025
## High Level Overview of Change

This PR removes the last of redux from the codebase. The only two pieces
left were Account and Token.

It also removes all mentions of gravatars.

This also reduces the size of the build by about 35kb.

There were some build issues that required regenerating the
package-lock, which is almost all of the diff.

### Context of Change

* ripple/explorer#649
* ripple/explorer#640
* ripple/explorer#635
* ripple/explorer#634
* ripple/explorer#1100

### Type of Change

- [x] Refactor (non-breaking change that only restructures code)

### TypeScript/Hooks Update

N/A

## Test Plan

Tests were fixed to handle the refactor.

---------

Co-authored-by: Ashray Chowdhry <achowdhry@ripple.com>
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