Skip to content

fix(predict): disable Deposit Wallet withdrawals#29941

Merged
matallui merged 6 commits into
mainfrom
predict/dw-disable-withdraw
May 11, 2026
Merged

fix(predict): disable Deposit Wallet withdrawals#29941
matallui merged 6 commits into
mainfrom
predict/dw-disable-withdraw

Conversation

@matallui

@matallui matallui commented May 9, 2026

Copy link
Copy Markdown
Contributor

Description

Temporarily disables the Predict withdraw entry point for Deposit Wallet users until Deposit Wallet withdrawals are fully supported.

Deposit Wallet users with a Predict balance now see a dismissible bottom sheet explaining that withdrawals are currently unavailable and to contact Customer Service for assistance. Legacy/Safe users continue through the existing withdraw flow.

This is intentionally a temporary UI guard and should be removed once Deposit Wallet withdraw support ships.

Changelog

CHANGELOG entry: Fixed Predict withdrawals to show a temporary unavailable message for Deposit Wallet users.

Related issues

Fixes: PRED-869

Manual testing steps

Feature: Predict Deposit Wallet withdrawals

  Scenario: Deposit Wallet user sees withdrawals unavailable notice
    Given a Predict Deposit Wallet user has an available balance
    When user taps Withdraw on the Predict balance card
    Then a bottom sheet is displayed with the title "Withdrawals are currently unavailable"
    And the bottom sheet description says "For assistance withdrawing your funds, please contact Customer Service."
    And tapping "Got it" dismisses the bottom sheet

  Scenario: Safe user keeps the existing withdraw flow
    Given a Predict Safe user has an available balance
    When user taps Withdraw on the Predict balance card
    Then the existing withdraw flow is opened
    And the withdrawals unavailable bottom sheet is not displayed

Validation run locally:

  • yarn lint:tsc
  • yarn eslint app/components/UI/Predict/components/PredictWithdrawUnavailableSheet/PredictWithdrawUnavailableSheet.tsx app/components/UI/Predict/components/PredictWithdrawUnavailableSheet/PredictWithdrawUnavailableSheet.test.tsx --cache
  • yarn jest app/components/UI/Predict/components/PredictWithdrawUnavailableSheet/PredictWithdrawUnavailableSheet.test.tsx --runInBand printed PASS for all tests, then hit the known local Jest OOM after completion.

Screenshots/Recordings

Before

N/A - PR changes the Deposit Wallet withdraw press behavior from launching unsupported withdraw handling to displaying a temporary unavailable bottom sheet.

After

Manually verified in the iOS simulator: Deposit Wallet users see the withdrawals unavailable bottom sheet and can dismiss it with "Got it".

Simulator Screenshot - mm-blue - 2026-05-08 at 20 39 36

Pre-merge author checklist

Performance checks (if applicable)

  • N/A - no performance-sensitive code path changed; Android performance testing is not applicable.
    • Ideally on a mid-range device; emulator is acceptable
  • N/A - no performance-sensitive code path changed; power-user scenario testing is not applicable.
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • N/A - no new production performance instrumentation is required for this temporary UI guard.

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.

Note

Medium Risk
Changes the withdrawal entry point behavior in the Predict balance card based on detected wallet type, which can block or allow access to a funds-moving flow. Risk is mitigated by added unit/E2E coverage and a conservative default that disables withdraw while account state is unknown.

Overview
Disables Predict withdrawals for Deposit Wallet users by gating the Withdraw button on usePredictAccountState and routing Deposit Wallet presses to a temporary “withdrawals unavailable” bottom sheet.

Adds the new PredictWithdrawUnavailableSheet component (with i18n strings and test IDs) and wires it into PredictFeed so it can be opened via a ref callback; Safe/legacy users continue to call withdraw() as before, and the Withdraw button is disabled until wallet type is resolved.

Updates unit tests and Detox/E2E mocks to cover wallet-type branching and keep the withdraw smoke test on the legacy Safe path (new LEGACY_SAFE_WALLET_ADDRESS + POLYMARKET_LEGACY_SAFE_ACCOUNT_MOCKS).

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

@matallui matallui added the team-predict Predict team label May 9, 2026
@matallui matallui self-assigned this May 9, 2026
@github-actions

github-actions Bot commented May 9, 2026

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.

@matallui matallui marked this pull request as ready for review May 9, 2026 02:55
@matallui matallui requested a review from a team as a code owner May 9, 2026 02:55
@github-actions github-actions Bot added the size-M label May 9, 2026
Comment thread app/components/UI/Predict/components/PredictBalance/PredictBalance.tsx Outdated
@matallui matallui added the force-builds Forces e2e native builds to trigger label May 9, 2026
caieu
caieu previously approved these changes May 9, 2026
@matallui matallui enabled auto-merge May 9, 2026 14:23
@matallui matallui disabled auto-merge May 9, 2026 14:23

@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 4a63354. Configure here.

@matallui matallui requested a review from a team as a code owner May 10, 2026 01:15
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.54%. Comparing base (3751d9a) to head (1699706).

Files with missing lines Patch % Lines
...edict/components/PredictBalance/PredictBalance.tsx 77.77% 1 Missing and 1 partial ⚠️
...nents/UI/Predict/views/PredictFeed/PredictFeed.tsx 75.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #29941   +/-   ##
=======================================
  Coverage   81.54%   81.54%           
=======================================
  Files        5343     5344    +1     
  Lines      142128   142146   +18     
  Branches    32411    32415    +4     
=======================================
+ Hits       115894   115910   +16     
- Misses      18302    18303    +1     
- Partials     7932     7933    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

E2E Test Selection:
The changes are focused entirely on the Polymarket Predictions feature area:

  1. PredictBalance.tsx: Added onDepositWalletWithdrawPress prop and integrated usePredictAccountState hook to detect wallet type. The withdraw button is now disabled until account state loads, and "deposit-wallet" users are redirected to a new unavailable sheet instead of the withdraw flow.

  2. PredictWithdrawUnavailableSheet (new component): A bottom sheet shown to deposit-wallet users explaining withdrawals are temporarily unavailable, with a "Got it" CTA.

  3. PredictFeed.tsx: Wired up the new sheet via a ref and passes the handler through the component tree (AnimatedHeader → PredictFeedHeader → PredictBalance).

  4. E2E test infrastructure: Added POLYMARKET_LEGACY_SAFE_ACCOUNT_MOCKS to keep the withdraw smoke test on the legacy Safe path, added POLYMARKET_ACTIVITY_MOCKS, and added LEGACY_SAFE_WALLET_ADDRESS constant.

  5. Page objects: Updated PredictBalance.ts to use testID-based selector for withdraw button and wait for it to be enabled before tapping.

  6. Test IDs & locales: New test IDs for the unavailable sheet elements and new i18n strings.

Tag selection rationale:

  • SmokePredictions: Directly affected — the withdraw flow, balance display, and position management are all modified. The new sheet and wallet-type guard change the withdraw UX path.
  • SmokeWalletPlatform: Required per SmokePredictions tag description — Predictions is a section inside the Trending tab, so changes to Predictions views affect Trending.
  • SmokeConfirmations: Required per SmokePredictions tag description — opening/closing positions are on-chain transactions that go through confirmations. The withdraw flow also involves confirmations.

No other tags are warranted — changes are isolated to the Predictions/Polymarket feature with no impact on accounts, networks, swaps, browser, snaps, or other areas.

Performance Test Selection:
No performance-sensitive changes are present. The modifications are limited to adding a new bottom sheet component, a wallet-type guard in the withdraw flow, and updating E2E test infrastructure. There are no changes to list rendering, state management at scale, app startup/initialization, or other performance-critical paths.

View GitHub Actions results

@matallui matallui enabled auto-merge May 11, 2026 02:40
@sonarqubecloud

Copy link
Copy Markdown

@matallui matallui added this pull request to the merge queue May 11, 2026
Merged via the queue into main with commit b44e29a May 11, 2026
102 checks passed
@matallui matallui deleted the predict/dw-disable-withdraw branch May 11, 2026 09:48
@github-actions github-actions Bot locked and limited conversation to collaborators May 11, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.78.0 Issue or pull request that will be included in release 7.78.0 label May 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

force-builds Forces e2e native builds to trigger release-7.78.0 Issue or pull request that will be included in release 7.78.0 size-M team-predict Predict team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants