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

[Bug]: Initiating a swap from the "All networks" assets view for a token on a different network than the one currently selected results in the token balance being displayed as zero on the swap screen #28509

Closed
sleepytanya opened this issue Nov 16, 2024 · 12 comments · Fixed by #28707
Labels
portfolio-view Used for PRs and issues related to Q4 2024 portfolio view release-12.9.0 Issue or pull request that will be included in release 12.9.0 Sev2-normal Normal severity; minor loss of service or inconvenience. team-wallet-ux type-bug

Comments

@sleepytanya
Copy link
Contributor

sleepytanya commented Nov 16, 2024

Describe the bug

Attempting to initiate a swap from the "All networks" assets view for a token on a different network than the one currently selected results in the token balance being displayed as zero. Transaction can't be submitted.

Build https://drive.google.com/file/d/1qhGX0lnrTX47M_7kbqBmhOXTd8HvmflL/view?usp=drive_link

Expected behavior

Screenshots/Recordings

swapTokenBalance.mov

Steps to reproduce

  1. Switch to 'All network' view
  2. Select token on a different network
  3. Start swap

Error messages or log output

No response

Detection stage

On the development branch

Version

dev build

Build type

None

Browser

Chrome

Operating system

MacOS

Hardware wallet

No response

Additional context

No response

Severity

No response

@sleepytanya sleepytanya added type-bug team-wallet-ux portfolio-view Used for PRs and issues related to Q4 2024 portfolio view labels Nov 16, 2024
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by team Nov 16, 2024
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by severity Nov 16, 2024
@gambinish
Copy link
Contributor

Addressed here: 0235189

@sleepytanya
Copy link
Contributor Author

sleepytanya commented Nov 19, 2024

@gambinish @jonybur
Balance is not 0 but the message about insufficient token balance is shown under the actual token balance. After destination token is selected, the message disappears.

insufficientBalance.mov

@Unik0rnMaggie
Copy link
Contributor

Issue is not present in the qa-3 build.

The balance of the token seems to be updated correctly on the swap screen.

Swap.from.other.network.than.the.one.selected.mov

@gambinish
Copy link
Contributor

I'm about to release another build qa-5. Can we verify that this bug has been fixed, so that we can close this out?

@sleepytanya
Copy link
Contributor Author

sleepytanya commented Nov 21, 2024

@gambinish
Same behavior as in the previous comment - Balance is not 0 but the message about insufficient token balance is shown under the actual token balance. After destination token is selected, the message disappears. Tx can be succesfully submitted on the correct network:

Screenshot 2024-11-21 at 01 03 05
1.mov

@Unik0rnMaggie
Copy link
Contributor

Confirming same bahavior in qa 5- build:

After destination token is selected, the message disappears:

Screen.Recording.2024-11-21.at.12.56.59.mov

@benjisclowder benjisclowder added the Sev2-normal Normal severity; minor loss of service or inconvenience. label Nov 21, 2024
@gambinish
Copy link
Contributor

Thanks, this sounds like a messaging issue that should be a quick fix. Likely still in qa-6, but I can look at fixing this tomorrow

@sleepytanya
Copy link
Contributor Author

sleepytanya commented Nov 23, 2024

@gambinish

The 'Not enough token' message is not related to the fact that user selects the token on a different network.
It happens for all non-native tokens if swap is initiated from the token details screen, it can be token on the currently selected network as well as token from another network:

Screen.Recording.2024-11-23.at.00.45.35.mov

@Unik0rnMaggie
Copy link
Contributor

Reproduced on qa-7 build, when swapping non native tokens from the token details screen.

The message disappears after selecting the token to swap to

Swap.from.token.details.screen.mov

@gambinish
Copy link
Contributor

This PR should address this issue: #28707 will try to include in the qa-8 build

@Unik0rnMaggie
Copy link
Contributor

Not present in qa-8 build:

Swap.non-native.from.token.details.screen.mov

@gambinish
Copy link
Contributor

Closing, since this seems to be fixed on qa-8

@github-project-automation github-project-automation bot moved this from To be fixed to Fixed in Bugs by severity Nov 26, 2024
@github-project-automation github-project-automation bot moved this from To be fixed to Fixed in Bugs by team Nov 26, 2024
github-merge-queue bot pushed a commit that referenced this issue Nov 26, 2024
## **Description**

Decimal balance are needed to be passed along with the rest of the token
info in order to properly prepopulate the swaps UI.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/28707?quickstart=1)

## **Related issues**

Fixes: #28509

## **Manual testing steps**

1. Navigate from AssetList to TokenDetails to Swap UI
2. Populate text field with a balance amount
3. If balance is lower than the token balance, do not show the warning.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.
@metamaskbot metamaskbot added the release-12.9.0 Issue or pull request that will be included in release 12.9.0 label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
portfolio-view Used for PRs and issues related to Q4 2024 portfolio view release-12.9.0 Issue or pull request that will be included in release 12.9.0 Sev2-normal Normal severity; minor loss of service or inconvenience. team-wallet-ux type-bug
Projects
Archived in project
Status: Fixed
Development

Successfully merging a pull request may close this issue.

5 participants