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

Merged
merged 4 commits into from
Oct 15, 2024

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%)

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

Builds ready [bef65f6]
Page Load Metrics (1732 ± 110 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint149523921740223107
domContentLoaded14802299169520196
load148824091732230110
domInteractive18202514220
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

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarCloud

@metamaskbot
Copy link
Collaborator

Builds ready [c2bcb19]
Page Load Metrics (1786 ± 62 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint14932119178713364
domContentLoaded14862102176012861
load14952111178613062
domInteractive2710444199
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 151 Bytes (0.00%)
  • common: 352 Bytes (0.00%)

@martahj martahj marked this pull request as ready for review October 14, 2024 00:34
@martahj martahj added this pull request to the merge queue Oct 15, 2024
Merged via the queue into develop with commit 5814224 Oct 15, 2024
77 of 78 checks passed
@martahj martahj deleted the debugging-linea branch October 15, 2024 15:39
@github-actions github-actions bot locked and limited conversation to collaborators Oct 15, 2024
@metamaskbot metamaskbot added the release-12.7.0 Issue or pull request that will be included in release 12.7.0 label Oct 15, 2024
@gauthierpetetin gauthierpetetin added release-12.6.0 Issue or pull request that will be included in release 12.6.0 and removed release-12.7.0 Issue or pull request that will be included in release 12.7.0 labels Oct 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.6.0 Issue or pull request that will be included in release 12.6.0 team-swaps
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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