Skip to content

fix: insufficient fund alert on money account deposit page#31678

Open
jpuri wants to merge 3 commits into
mainfrom
fund_alert_fix
Open

fix: insufficient fund alert on money account deposit page#31678
jpuri wants to merge 3 commits into
mainfrom
fund_alert_fix

Conversation

@jpuri

@jpuri jpuri commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Description

Fix insufficient fund alert on money account deposit page.

Changelog

CHANGELOG entry:

Related issues

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

Manual testing steps

NA

Screenshots/Recordings

NA

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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.

@jpuri jpuri requested a review from a team as a code owner June 15, 2026 03:21
@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 Jun 15, 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.

const isPerpsOrPredict = hasTransactionType(
transactionMeta,
PERPS_PREDICT_TRANSACTION_TYPES,
);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is fix for small issue introduced by previous PR: #31641

@jpuri jpuri enabled auto-merge June 15, 2026 03:23
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

E2E Test Selection:
The PR contains two functional bug fixes in confirmation hooks:

  1. usePendingAmountAlerts.ts: Changes pendingAmountUsd from pendingTokenAmount to pendingFiatAmount ?? '0'. This fixes the insufficient pay token balance alert to use the correct fiat amount instead of the token amount. This affects pay flows in confirmations (perps, predict, money account).

  2. useIsMoneyAccountFlagDefault.ts: Adds a transaction type guard so the defaultPaySelectedSection: 'money-account' feature flag only applies to perps/predict transaction types (perpsDeposit, perpsWithdraw, predictDeposit, predictWithdraw). This prevents the money-account default from incorrectly applying to unrelated flows like simpleSend, swap, bridge, etc.

Tag selection rationale:

  • SmokeConfirmations: Both hooks are in the confirmations directory and directly affect confirmation UI behavior (alerts, pay-with selection). The usePendingAmountAlerts is used in useTransactionCustomAmountAlerts, and useIsMoneyAccountFlagDefault is used in pay-with-row component and useDefaultPaySelectedSection.
  • SmokePerps: perpsDeposit and perpsWithdraw transaction types are explicitly listed in the new PERPS_PREDICT_TRANSACTION_TYPES constant. The money-account default and balance alerts directly affect perps deposit/withdraw flows.
  • SmokePredictions: predictDeposit and predictWithdraw transaction types are also in PERPS_PREDICT_TRANSACTION_TYPES. Same reasoning as SmokePerps.
  • SmokeMoney: The useIsMoneyAccountFlagDefault hook is about money account selection in pay flows. The bug fix ensures money-account is only defaulted for appropriate transaction types, directly affecting money account flows.
  • SmokeWalletPlatform: Required by SmokePerps and SmokePredictions descriptions (Trending section contains Perps and Predictions views).

The test files are unit tests only and don't affect E2E test selection directly.

Performance Test Selection:
The changes are limited to React hooks in the confirmations directory that affect alert logic and pay-with selection. These are UI logic fixes that don't impact app launch, login, onboarding, asset loading, swap execution performance, or any other performance-measured flows. No performance tests are warranted.

View GitHub Actions results

@github-actions github-actions Bot added the risk:low AI analysis: low risk label Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed risk:low AI analysis: low risk size-M team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant