Skip to content

Conversation

@runway-github
Copy link
Contributor

@runway-github runway-github bot commented Nov 21, 2025

Description

In some device on edge cases, sometime the MetaMask riv logo does not
appear during the onboarding screen animation.
This is due to race conditions between state triggers and the rive
onPlay state.

This PR wait for onPlay state before fire the inputState

Changelog

CHANGELOG entry: null

Related issues

Fixes:
#23048

  • race condition in rive animations when animation fail to start.

Manual testing steps

Feature: onboarding

  Scenario: user open the app after install
    Given user open the app after install
    Then user should see the Metamask riv logo 

Screenshots/Recordings

Before

IMG_0012.MOV

After

IMG_0014.MOV

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

Waits for Rive onPlay before firing state/inputs, preventing missed onboarding and fox animations.

  • UI:
    • OnboardingAnimation: Gate startRiveAnimation behind isPlaying set via onPlay; remove autoplay usage; maintain timing for logo move and fox start.
    • FoxAnimation: Fire FoxRaiseUp only after onPlay sets isPlaying; remove autoplay usage.
  • Testing/Mocks:
    • __mocks__/rive-react-native: Add onPlay prop and invoke it on mount via useEffect to simulate readiness; minor hook import updates.

Written by Cursor Bugbot for commit 2e21954. This will update automatically on new commits. Configure here.


Co-authored-by: Gaurav Goel grvgoel19@gmail.com 2ab978e

…y ) cp-7.60.0 (#22982)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

* fix: race condition in rive animations when animation fail to start.
* Jira: https://consensyssoftware.atlassian.net/browse/SL-332
* Issue: #23048

In some device on edge cases, sometime the MetaMask riv logo does not
appear during the onboarding screen animation.
This is due to race conditions between state triggers and the rive
onPlay state.

This PR wait for onPlay state before fire the inputState

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Fixes:
#23048
* race condition in rive animations when animation fail to start.
## **Manual testing steps**

```gherkin
Feature: onboarding

  Scenario: user open the app after install
    Given user open the app after install
    Then user should see the Metamask riv logo 
```

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->


https://github.com/user-attachments/assets/834c82d8-9fbf-4c96-943d-1ea067115401




### **After**
<!-- [screenshots/recordings] -->


https://github.com/user-attachments/assets/c4bca6d3-3bec-4be8-a68a-882770676ac4


## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] 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.



<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Delay animation triggers until Rive reports onPlay, fixing race
conditions that caused onboarding/fox animations to not start.
> 
> - **UI**
> - `FoxAnimation`: add `isPlaying` state and `onPlay` handler; trigger
`fireState('FoxRaiseUp', ...)` only after play starts; remove `autoplay`
usage.
> - `OnboardingAnimation`: gate `startRiveAnimation` on `isPlaying`; add
`onPlay` to set ready state; remove `autoplay` usage.
> - **Testing/Mocks**
> - Update `app/__mocks__/rive-react-native.tsx` to accept `onPlay` and
invoke it on mount for tests.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
b36851c. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Gaurav Goel <grvgoel19@gmail.com>
@github-actions
Copy link
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.

@metamaskbot metamaskbot added the team-bots Bot team (for MetaMask Bot, Runway Bot, etc.) label Nov 21, 2025
@github-actions
Copy link
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 85%
click to see 🤖 AI reasoning details

After thorough investigation, these changes are limited to animation-related UI components and test infrastructure:

Changed Files Analysis:

  1. app/__mocks__/rive-react-native.tsx - Mock file for Rive animation library used in unit tests
  2. app/components/UI/FoxAnimation/FoxAnimation.tsx - UI animation component displaying the MetaMask fox
  3. app/components/UI/OnboardingAnimation/OnboardingAnimation.tsx - UI animation component for onboarding wordmark

Impact Assessment:

  • These are purely UI/visual components related to animations
  • The FoxAnimation component is used in Login/Onboarding views for visual effects
  • The OnboardingAnimation component is used in the initial onboarding screen
  • The mock file is only used by unit tests (FoxAnimation.test.tsx, OnboardingAnimation.test.tsx)
  • No functional logic changes to core wallet features, account management, transactions, or critical flows
  • These animations run during onboarding but don't affect the actual onboarding functionality
  • In E2E tests, animations are typically skipped (isE2E checks in the code show animations are bypassed)

Why No Tests Required:

  1. These are cosmetic/visual animation changes only
  2. E2E tests already bypass animations in E2E mode (checked via isE2E flag in OnboardingAnimation)
  3. The mock file only affects unit test infrastructure, not E2E behavior
  4. No changes to critical paths: controllers, Engine, core modules, or testing infrastructure
  5. Unit tests cover the functionality adequately
  6. Visual animations don't impact wallet functionality being tested by E2E suites

Risk Level: Low - Pure UI/visual changes with no impact on wallet functionality, account management, transactions, or user flows that E2E tests verify.

View GitHub Actions results

@sonarqubecloud
Copy link

@joaoloureirop joaoloureirop merged commit 3c675d6 into release/7.60.0 Nov 21, 2025
90 checks passed
@joaoloureirop joaoloureirop deleted the runway-cherry-pick-7.60.0-1763700347 branch November 21, 2025 11:07
@github-actions github-actions bot locked and limited conversation to collaborators Nov 21, 2025
@metamaskbot metamaskbot added the release-7.60.0 Issue or pull request that will be included in release 7.60.0 label Nov 21, 2025
@metamaskbot
Copy link
Collaborator

No release label on PR. Adding release label release-7.60.0 on PR, as PR was cherry-picked in branch 7.60.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.60.0 Issue or pull request that will be included in release 7.60.0 size-S team-bots Bot team (for MetaMask Bot, Runway Bot, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants