Skip to content

Conversation

@Ernesto-tha-great
Copy link

@Ernesto-tha-great Ernesto-tha-great commented Mar 13, 2025

  • Debounce time for updating the swap quote was reduced from 500ms to 300ms.
  • Added an error field in the QuoteUpdate type to store error messages.
  • Introduced a retry system to handle network failures and transient errors.
  • Ensures the user always sees the latest price without manually refreshing.
  • Improved readability and maintainability by restructuring the fetchQuote logic

Latest build: extension-builds-3803 (as of Thu, 10 Apr 2025 12:03:33 GMT).

Copy link
Contributor

@Shadowfiend Shadowfiend left a comment

Choose a reason for hiding this comment

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

Left some notes! Thanks for contributing these changes!

@Ernesto-tha-great
Copy link
Author

@Shadowfiend @hyphenized

I have taken the feedback into account and refactored the PR. Does this look better?

@Shadowfiend
Copy link
Contributor

The updated PR still does auto-refreshes but they're also being done on the frontend side, am I reading this right? Probably should stick to one or the other.

@Ernesto-tha-great
Copy link
Author

@Shadowfiend

Please take a look once more. I have removed the refresh on the FE

@Shadowfiend
Copy link
Contributor

You may have had a rebase issue here—the history is looking gnarly. Maybe see if you can check out latest main and then cherry pick c6aa8be and 203f85c and force push over the current branch.

priceImpact={quote?.priceDetails?.priceImpact}
isPriceDetailsLoading={isLoadingPriceDetails}
showPriceDetails
// FIXME: Merge master asset list with account balances.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this no longer relevant?

Copy link
Author

Choose a reason for hiding this comment

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

yes. its been fixed

buyAsset,
gasPrice:
// Let's use the gas price from 0x API for Optimism
// to avoid problems with gas price on Optimism Bedrock.
Copy link
Contributor

Choose a reason for hiding this comment

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

This feels relevant still.

Copy link
Author

Choose a reason for hiding this comment

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

ill add it back in.

@Ernesto-tha-great
Copy link
Author

@Shadowfiend

All done now.

Copy link
Collaborator

@hyphenized hyphenized left a comment

Choose a reason for hiding this comment

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

This doesn't seem to be auto refreshing quotes anymore?

@Ernesto-tha-great
Copy link
Author

This doesn't seem to be auto refreshing quotes anymore?

yes. we removed the auto refresh from the frontend so its being handled on the backend.

@hyphenized
Copy link
Collaborator

This doesn't seem to be auto refreshing quotes anymore?

yes. we removed the auto refresh from the frontend so its being handled on the backend.

Okay I see that the front end code for auto refresh was removed but I don't see anything in the backend handling that?

@Ernesto-tha-great
Copy link
Author

This doesn't seem to be auto refreshing quotes anymore?

yes. we removed the auto refresh from the frontend so its being handled on the backend.

Okay I see that the front end code for auto refresh was removed but I don't see anything in the backend handling that?

@hyphenized @Shadowfiend
Take a look now if this is better. I have resolved the auto refresh to be handled in the hook (swap.ts) every 10 sec.

@Ernesto-tha-great
Copy link
Author

@hyphenized @Shadowfiend bumping this up

Copy link
Contributor

@Shadowfiend Shadowfiend left a comment

Choose a reason for hiding this comment

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

One stylistic note, otherwise need to test this but looks good to me.

@Ernesto-tha-great
Copy link
Author

@Shadowfiend

all done!

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