Skip to content

chore: migrating money account deposit fund alert to alert system#28724

Merged
jpuri merged 2 commits into
mainfrom
money_acc_alert_fix
Apr 13, 2026
Merged

chore: migrating money account deposit fund alert to alert system#28724
jpuri merged 2 commits into
mainfrom
money_acc_alert_fix

Conversation

@jpuri

@jpuri jpuri commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

Description

Using alert system for money account related errors.

Changelog

CHANGELOG entry:

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/CONF-1182

Manual testing steps

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

NA

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.

Note

Medium Risk
Changes how moneyAccountDeposit “no funds” is surfaced by introducing a new blocking alert and wiring it into the shared pending-amount alert pipeline, which can affect confirm-button enablement and user flow. Risk is limited to confirmations/UX and is covered by added unit tests.

Overview
Moves the moneyAccountDeposit “no funds” state into the confirmations alert system by introducing a new blocking AccountNoFunds alert (with metrics mapping) and feeding it through usePendingAmountAlerts.

Removes the old inline “no funds” red text from CustomAmountInfo, updates tests to assert alert-driven rendering, and adds new i18n under alert_system.account_no_funds while deleting the legacy confirm.no_funds_use_different_account string.

Reviewed by Cursor Bugbot for commit c92ce45. Bugbot is set up for automated code reviews on this repo. Configure here.

@jpuri jpuri requested a review from a team as a code owner April 13, 2026 10:58
@jpuri jpuri added team-confirmations Push issues to confirmations team no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed labels Apr 13, 2026
@github-actions

Copy link
Copy Markdown
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.

@jpuri jpuri enabled auto-merge April 13, 2026 10:58
@github-actions github-actions Bot added size-M risk-medium Moderate testing recommended · Possible bug introduction risk labels Apr 13, 2026
@github-actions github-actions Bot added risk-medium Moderate testing recommended · Possible bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Apr 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeConfirmations, SmokePerps, SmokeWalletPlatform, SmokeCard, SmokeTrade
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 88%
click to see 🤖 AI reasoning details

E2E Test Selection:
The PR introduces a new useAccountNoFundsAlert hook that creates a blocking "Danger" severity alert for moneyAccountDeposit transactions when the selected account has no available tokens. This replaces an inline text display in custom-amount-info.tsx with a proper alert system integration.

Key changes:

  1. New useAccountNoFundsAlert hook - blocking alert for moneyAccountDeposit with no tokens
  2. usePendingAmountAlerts - integrates the new alert into the pending amount alerts pipeline
  3. custom-amount-info.tsx - removes inline "no funds" text (now handled by alert system)
  4. alerts.ts - adds AccountNoFunds enum value
  5. useConfirmationAlertMetrics.ts - maps new alert to analytics
  6. en.json - adds new alert string, removes old inline string

Tag selection reasoning:

  • SmokeConfirmations: Core change is to the confirmation alert system - new blocking alert type, alert key, metrics mapping. Any confirmation flow could be affected by alert system changes.
  • SmokePerps: moneyAccountDeposit is the transaction type used in Perps Add Funds flow. The new blocking alert directly affects this flow when account has no funds. Per tag description, SmokePerps requires SmokeConfirmations.
  • SmokeWalletPlatform: Required by SmokePerps tag description (Perps is a section inside Trending tab).
  • SmokeCard: Card's Add Funds feature uses deposit flows that could involve moneyAccountDeposit transactions. The blocking alert would affect this flow.
  • SmokeTrade: Required by SmokeCard tag description (Add Funds uses swaps which require SmokeTrade).

The change is medium risk - it modifies the alert system for a specific transaction type (moneyAccountDeposit) and could affect user flows in Perps and Card features if the alert incorrectly blocks or fails to block transactions.

Performance Test Selection:
The changes are focused on alert logic and UI text replacement in the confirmation flow. No performance-sensitive code paths are modified - no list rendering, no data loading, no state management changes, no app startup code. The new hook uses useMemo appropriately and is lightweight. No performance tests are warranted.

View GitHub Actions results

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c92ce45. Configure here.

@github-actions

Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
11 value mismatches detected (expected — fixture represents an existing user).
View details

@sonarqubecloud

Copy link
Copy Markdown

InsufficientPayTokenFees = 'insufficient_pay_token_fees',
InsufficientPerpsBalance = 'insufficient_perps_balance',
InsufficientPredictBalance = 'insufficient_predict_balance',
AccountNoFunds = 'account_no_funds',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor alphabetical

[AlertKeys.InsufficientPayTokenNative]: 'insufficient_funds_for_gas',
[AlertKeys.InsufficientPerpsBalance]: 'insufficient_funds',
[AlertKeys.InsufficientPredictBalance]: 'insufficient_funds',
[AlertKeys.AccountNoFunds]: 'account_no_funds',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor alphabetical

@jpuri jpuri added this pull request to the merge queue Apr 13, 2026
Merged via the queue into main with commit 03015f4 Apr 13, 2026
103 checks passed
@jpuri jpuri deleted the money_acc_alert_fix branch April 13, 2026 12:00
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 13, 2026
@metamaskbot metamaskbot added the release-7.74.0 Issue or pull request that will be included in release 7.74.0 label Apr 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.74.0 Issue or pull request that will be included in release 7.74.0 risk-medium Moderate testing recommended · Possible bug introduction risk size-M team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants