Skip to content

fix: incorrect logic on emitting event#519

Merged
xavier-brochard merged 3 commits intomainfrom
NWNT-550-investigate-discrepancy-in-sol-balance-display-in-meta-mask
Sep 8, 2025
Merged

fix: incorrect logic on emitting event#519
xavier-brochard merged 3 commits intomainfrom
NWNT-550-investigate-discrepancy-in-sol-balance-display-in-meta-mask

Conversation

@xavier-brochard
Copy link
Copy Markdown
Contributor

@xavier-brochard xavier-brochard commented Sep 8, 2025

The Solana Snap was not properly notifying the client when native SOL balance changed from non-zero to zero.

AssetsService.hasChanged(asset, savedAssets);

const balancesUpdatedPayload = assets
.filter(hasNonZeroRawAmount)
Copy link
Copy Markdown
Contributor Author

@xavier-brochard xavier-brochard Sep 8, 2025

Choose a reason for hiding this comment

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

This is really what was causing the issue.

cursor[bot]

This comment was marked as outdated.

ulissesferreira
ulissesferreira previously approved these changes Sep 8, 2025
aganglada
aganglada previously approved these changes Sep 8, 2025
Copy link
Copy Markdown
Contributor

@aganglada aganglada left a comment

Choose a reason for hiding this comment

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

🎉

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Sep 8, 2025

@xavier-brochard xavier-brochard merged commit 3a19835 into main Sep 8, 2025
10 checks passed
@xavier-brochard xavier-brochard deleted the NWNT-550-investigate-discrepancy-in-sol-balance-display-in-meta-mask branch September 8, 2025 13:00
github-merge-queue bot pushed a commit to MetaMask/metamask-mobile that referenced this pull request Sep 8, 2025
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

This PR bumps the Solana snap to its latest version.

## **Changelog**

CHANGELOG entry: Notify client when native SOL balance reaches zero
([#519](MetaMask/snap-solana-wallet#519))

## **Related issues**

Fixes:

## **Manual testing steps**

```gherkin
Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]
```

## **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 Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.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-mobile/blob/main/.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.
github-merge-queue bot pushed a commit to MetaMask/metamask-extension that referenced this pull request Sep 9, 2025
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

This PR bumps the Solana snap to its latest version.

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

## **Changelog**

CHANGELOG entry: Notify client when native SOL balance reaches zero
([#519](MetaMask/snap-solana-wallet#519))

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **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/main/.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/main/.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.
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