Skip to content

fix(predict): fix unregistered wallet issue on first deposit cp-7.77.0 cp-7.78.0#30267

Merged
matallui merged 2 commits into
mainfrom
predict/fix-unregistered-wallet-issue
May 15, 2026
Merged

fix(predict): fix unregistered wallet issue on first deposit cp-7.77.0 cp-7.78.0#30267
matallui merged 2 commits into
mainfrom
predict/fix-unregistered-wallet-issue

Conversation

@matallui
Copy link
Copy Markdown
Contributor

@matallui matallui commented May 15, 2026

Description

Fixes the first-deposit flow for new Predict users whose Polymarket deposit wallet has been created but is not fully registered yet.

Polymarket advised that STATE_MINED can happen before the wallet is usable on their side, so the deposit wallet relayer polling now treats only STATE_CONFIRMED as a successful completion state. This keeps polling through mined responses until Polymarket confirms the wallet, preventing the follow-up batch transaction from failing with "wallet is not registered".

Changelog

CHANGELOG entry: Fixed a bug that caused a user's first Predict deposit to fail while their deposit wallet was still registering.

Related issues

Fixes: PRED-886

Manual testing steps

Feature: Predict first deposit wallet registration

  Scenario: user makes their first Predict deposit
    Given a new Predict user does not have a registered Polymarket deposit wallet

    When user starts their first deposit
    Then the app creates the deposit wallet
    And waits until the relayer reports STATE_CONFIRMED
    And proceeds with the wallet batch transaction without a "wallet is not registered" error

Screenshots/Recordings

N/A - logic-only relayer polling change.

Before

N/A

After

N/A

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.

Testing

  • yarn jest app/components/UI/Predict/providers/polymarket/depositWallet.test.ts --runInBand

Note

Medium Risk
Changes deposit-wallet relayer polling completion criteria, which can affect first-deposit transaction flow timing and success. Low code surface area but touches user-critical deposit execution behavior.

Overview
Fixes Predict first-deposit failures by tightening Polymarket relayer success detection: waitForDepositWalletTransaction now treats only STATE_CONFIRMED (not STATE_MINED) as a completion state before proceeding.

Updates the related unit test to expect continued polling through STATE_MINED/no-hash responses until a STATE_CONFIRMED transaction hash is returned.

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

@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.

@metamaskbotv2 metamaskbotv2 Bot added the team-predict Predict team label May 15, 2026
@matallui matallui changed the title fix(predict): fix unregistered wallet issue on first deposit fix(predict): fix unregistered wallet issue on first deposit cp-7.77.0 cp-7.78.0 May 15, 2026
@matallui matallui marked this pull request as ready for review May 15, 2026 17:45
@matallui matallui requested a review from a team as a code owner May 15, 2026 17:45
@matallui matallui enabled auto-merge May 15, 2026 18:03
@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 PR makes a targeted change to the Polymarket deposit wallet relayer success state detection: removing 'STATE_MINED' from RELAYER_SUCCESS_STATES, keeping only 'STATE_CONFIRMED'. This fixes a bug where the polling could complete prematurely (without a transaction hash) when the relayer returned STATE_MINED. The unit test is updated accordingly.

Impact is confined to the Polymarket Predictions deposit/position-opening flow. No shared components (navigation, modals, Engine, controllers) are affected.

Tags selected:

  • SmokePredictions: Directly covers the Polymarket prediction market deposit and position lifecycle flows that this change affects.
  • SmokeWalletPlatform: Required per SmokePredictions description ("also select SmokeWalletPlatform (Trending section)").
  • SmokeConfirmations: Required per SmokePredictions description ("also select SmokeConfirmations (opening/closing positions are on-chain transactions)").

No other tags are warranted as the change is isolated to the Predictions/Polymarket deposit wallet logic.

Performance Test Selection:
This change only modifies the relayer success state string comparison logic (removing STATE_MINED, keeping STATE_CONFIRMED). There is no UI rendering, data loading, list rendering, or initialization change that would impact app performance metrics.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

@matallui matallui added this pull request to the merge queue May 15, 2026
Merged via the queue into main with commit dafc42c May 15, 2026
176 of 181 checks passed
@matallui matallui deleted the predict/fix-unregistered-wallet-issue branch May 15, 2026 19:34
@github-actions github-actions Bot locked and limited conversation to collaborators May 15, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.79.0 Issue or pull request that will be included in release 7.79.0 label May 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.79.0 Issue or pull request that will be included in release 7.79.0 size-XS team-predict Predict team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants