Skip to content

fix: predict claim back dismissal cleanup#30474

Merged
pedronfigueiredo merged 2 commits into
mainfrom
pnf/investigate-claim-process-issue
May 21, 2026
Merged

fix: predict claim back dismissal cleanup#30474
pedronfigueiredo merged 2 commits into
mainfrom
pnf/investigate-claim-process-issue

Conversation

@pedronfigueiredo

@pedronfigueiredo pedronfigueiredo commented May 20, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR prevents Predict claim confirmations from being stranded when the user dismisses the full-screen confirmation with a back gesture instead of the close button.

The Predict claim screen now opts into the existing full-screen confirmation back-swipe cleanup hook, so gesture and Android hardware-back dismissals reject the active confirmation instead of only removing the route. The shared confirmation loader also disables gestures and consumes Android back presses while there is no approval request yet, so users cannot leave the loading screen before there is a request that can be rejected.

Root Cause

Predict claim used a custom close button that called the normal reject path, but the screen did not install the existing back-swipe cleanup hook used by other full-screen confirmations. A route-level back dismissal could therefore remove the confirmation UI while leaving the approval and unapproved transaction in controller state. In the real claim flow, that can leave the Predict pending claim entry active, causing later claim attempts to be treated as already in progress.

Original ticket: https://consensyssoftware.atlassian.net/browse/CONF-1375


Note

Medium Risk
Changes navigation gesture/back-button handling in the confirmations flow, which could affect user ability to exit confirmations if conditions are wrong. Main behavioral change is gated to the pre-approvalRequest loading state and full-screen Predict claim dismissals, with added tests to reduce regressions.

Overview
Prevents users from dismissing the Confirm loading state before an approvalRequest exists by disabling navigation gestures and consuming Android hardware back presses until there’s something to reject.

Updates the Predict claim confirmation info screen to opt into the shared useClearConfirmationOnBackSwipe cleanup so back-swipe/hardware-back dismissals trigger the normal reject path, and adds focused unit tests for both behaviors. Also updates fixture validation ignore lists to exclude engine.backgroundState.MoneyAccountController.moneyAccounts from schema comparisons.

Reviewed by Cursor Bugbot for commit 86388d2. 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-confirmations Push issues to confirmations team label May 20, 2026
@pedronfigueiredo pedronfigueiredo changed the title [codex] Fix predict claim back dismissal cleanup fix: predict claim back dismissal cleanup May 20, 2026
@pedronfigueiredo pedronfigueiredo added the no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed label May 20, 2026
@pedronfigueiredo pedronfigueiredo marked this pull request as ready for review May 20, 2026 17:48
@pedronfigueiredo pedronfigueiredo requested a review from a team as a code owner May 20, 2026 17:48
@metamaskbotv2 metamaskbotv2 Bot added the INVALID-PR-TEMPLATE PR's body doesn't match template label May 20, 2026
@pedronfigueiredo pedronfigueiredo requested a review from a team as a code owner May 21, 2026 09:27
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

E2E Test Selection:

Changes analyzed:

  1. tests/framework/fixtures/fixture-validation.ts (CRITICAL): Adds engine.backgroundState.MoneyAccountController.moneyAccounts to the ignored keys list. This prevents fixture validation failures when MoneyAccountController state is present in test fixtures. This is a test infrastructure fix that affects E2E tests using fixtures — particularly relevant to SmokeMoney (Card/fiat flows that use MoneyAccountController).

  2. confirm-component.tsx: Fixes navigation options setup — previously only set when approvalRequest existed, now always sets options with gestureEnabled: Boolean(approvalRequest). This prevents swipe-to-dismiss during loading state. Also fixes Android back handler to return true (blocking) instead of undefined. This is a core confirmation component change affecting ALL confirmation flows → SmokeConfirmations.

  3. predict-claim-info.tsx: Adds useClearConfirmationOnBackSwipe hook to PredictClaimInfo component, ensuring back-swipe properly clears the confirmation (consistent with staking/other confirmation types). This directly affects Predictions claim confirmation flows → SmokePredictions + SmokeConfirmations (per tag dependency rules).

  4. Test files: Unit tests for the above — no additional E2E impact.

Tag dependency chain:

  • SmokeConfirmations: Core confirmation component changed (confirm-component.tsx)
  • SmokePredictions: predict-claim-info.tsx changed (Predictions claim confirmation)
  • SmokeWalletPlatform: Required by SmokePredictions (Trending section dependency)
  • SmokeMoney: MoneyAccountController fixture validation change affects Card/fiat E2E tests

Not selected: SmokeStake (staking-claim/withdrawal/deposit already had useClearConfirmationOnBackSwipe — no change there), SmokeSwap (no swap-specific changes), SmokeAccounts/SmokeIdentity/SmokeNetworkAbstractions/SmokeNetworkExpansion/SmokeMultiChainAPI/SmokeBrowser/SmokeSnaps/SmokeSeedlessOnboarding/SmokePerps (no relevant changes).

Performance Test Selection:
No performance-sensitive changes detected. The confirm-component.tsx change is a navigation options fix (not rendering performance), predict-claim-info.tsx adds a hook for back-swipe handling (not rendering performance), and the fixture-validation.ts change is test infrastructure only. None of these changes affect UI rendering performance, data loading, account/network list components, or app startup in ways that would warrant performance testing.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@pedronfigueiredo pedronfigueiredo added this pull request to the merge queue May 21, 2026
Merged via the queue into main with commit de8a354 May 21, 2026
174 of 198 checks passed
@pedronfigueiredo pedronfigueiredo deleted the pnf/investigate-claim-process-issue branch May 21, 2026 12:39
@github-actions github-actions Bot locked and limited conversation to collaborators May 21, 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 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

INVALID-PR-TEMPLATE PR's body doesn't match template no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.79.0 Issue or pull request that will be included in release 7.79.0 size-M team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants