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: hackily wait longer for linea swap approval tx to increase chance of success #27810

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

martahj
Copy link
Contributor

@martahj martahj commented Oct 12, 2024

Description

Linea seems to be taking longer than other chains to process the approve transaction after it is submitted, so the trade transaction is erroring. This PR adds a hacky workaround where we artificially delay if we're on Linea to give the trade transaction more time. In the future, we'd want to avoid this hack, but for now it should increase the swap success rate on Linea.

With the delay, the token symbol also wasn't immediately populating on the awaiting swap page, so this PR also updates how it's retrieved.

Open in GitHub Codespaces

Related issues

Fixes: #27804

Manual testing steps

  1. Start a swap on Linea with a token that you have not granted approval for
  2. Observe that the swap does not fail

Screenshots/Recordings

Before

375871389-343ab5ee-1bcb-45cb-9d42-c753b80c1fea.mov

After

LineaSwap.mov

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot
Copy link
Collaborator

Builds ready [697d1f9]
Page Load Metrics (1683 ± 73 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint20320981551457219
domContentLoaded14892089166415273
load14932107168315273
domInteractive16108402311
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 151 Bytes (0.00%)
  • common: 352 Bytes (0.00%)

Copy link

sonarcloud bot commented Oct 13, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
42.1% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@martahj martahj marked this pull request as ready for review October 13, 2024 01:59
@martahj martahj requested review from a team as code owners October 13, 2024 01:59
@martahj martahj marked this pull request as draft October 13, 2024 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Swap of unapproved token fails on Linea
2 participants