Skip to content

fix(perps): prevent Android crash in tutorial carousel Rive animations cp-7.81.0#31547

Merged
michalconsensys merged 1 commit into
mainfrom
fix/perps-tutorial-carousel-android-crash
Jun 11, 2026
Merged

fix(perps): prevent Android crash in tutorial carousel Rive animations cp-7.81.0#31547
michalconsensys merged 1 commit into
mainfrom
fix/perps-tutorial-carousel-android-crash

Conversation

@michalconsensys

@michalconsensys michalconsensys commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Description

The Perps "Learn the basics" tutorial carousel crashes on Android when navigating through the screens.

Root cause: ScrollableTabView renders all child tabs simultaneously, which means 4–5 <Rive> components (one per tutorial screen with an animation) are all mounted with autoplay={true} at the same time. On Android, the Rive native renderer cannot handle multiple concurrent GPU-accelerated animation instances and crashes.

Fix: Only mount the <Rive> component for the currently visible tab (currentTab === index). This ensures a single native Rive renderer instance exists at any time. When the user swipes or taps Continue, the previous instance is unmounted and the next one takes its place.

iOS is unaffected because its Metal rendering pipeline handles concurrent Rive instances more gracefully.

Changelog

CHANGELOG entry: Fixed a crash on Android when navigating through the Perps tutorial carousel

Related issues

Fixes: #31540

Manual testing steps

Feature: Perps tutorial carousel stability on Android

  Scenario: user completes the full tutorial without crash
    Given the user has not completed the Perps tutorial
    When user taps Perps and goes through "Learn the Basics of Perps"
    Then the app does not crash
    And all tutorial screens display their Rive animations correctly

  Scenario: user re-enters tutorial from Perps home
    Given the user is on the Perps home screen
    When user scrolls down and taps "Learn the Basics of Perps"
    And user taps Continue through all screens
    Then the app does not crash
    And the user reaches the final screen successfully

Screenshots/Recordings

N/A — no visual change; this is a crash fix. The tutorial screens render identically, only one Rive animation is mounted at a time instead of all simultaneously.

Before

App crashes on Android when navigating through tutorial carousel screens.

After

Tutorial carousel completes without crash on Android.

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.

Note

Low Risk
Single conditional around Rive mounting in the tutorial carousel; behavior is unchanged except avoiding concurrent animations on Android.

Overview
Fixes an Android crash in the Perps “Learn the basics” tutorial by ensuring only one native Rive animation is mounted at a time.

ScrollableTabView keeps every tab’s children in the tree, so every screen with riveArtboardName used to mount <Rive autoplay> together. The change adds index in the screen map and renders the animation only when currentTab === index, so swiping or tapping Continue unmounts the previous instance before the next one loads. No intended UI change on iOS.

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

…ly active Rive animation

ScrollableTabView renders all children simultaneously, causing 4-5 Rive
native renderer instances to compete for GPU resources on Android. Only
mount the Rive component for the currently visible tab so a single
instance exists at any time.
@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.

@mm-token-exchange-service mm-token-exchange-service Bot added the team-perps Perps team label Jun 11, 2026
@michalconsensys michalconsensys changed the title fix(perps): prevent Android crash in tutorial carousel Rive animations fix(perps): prevent Android crash in tutorial carousel Rive animations cp-7.81.0 Jun 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

E2E Test Selection:
The change is in PerpsTutorialCarousel.tsx and consists of two related modifications:

  1. Adding index to the .map() callback parameters.
  2. Changing the Rive animation render condition from screen?.riveArtboardName to screen?.riveArtboardName && currentTab === index — this ensures the Rive animation only renders for the currently active carousel tab (a lazy/conditional rendering optimization).

This is a low-risk UI-only change within the Perps tutorial carousel. It doesn't touch core logic, state management, or navigation. The primary tag is SmokePerps. Per the tag dependency rules, selecting SmokePerps requires also selecting SmokeWalletPlatform (Perps is a section inside Trending) and SmokeConfirmations (Add Funds deposits are on-chain transactions). No other tags are impacted.

Performance Test Selection:
The change is a conditional rendering optimization for Rive animations in the Perps tutorial carousel. While it could theoretically reduce memory/CPU usage by not rendering off-screen animations, it does not affect any of the measured performance scenarios (account list, onboarding, login, swaps, launch, asset loading, predict, perps market loading/position management). The @PerformancePreps tag covers perps market loading and add funds flow, not the tutorial carousel. No performance tests are warranted.

View GitHub Actions results

@michalconsensys michalconsensys marked this pull request as ready for review June 11, 2026 10:24
@michalconsensys michalconsensys requested a review from a team as a code owner June 11, 2026 10:24
@Unik0rnMaggie

Copy link
Copy Markdown
Contributor

Unable to reproduce using the build from this branch.

Perps.fix.mp4

@michalconsensys michalconsensys added this pull request to the merge queue Jun 11, 2026
Merged via the queue into main with commit fe7877a Jun 11, 2026
135 checks passed
@michalconsensys michalconsensys deleted the fix/perps-tutorial-carousel-android-crash branch June 11, 2026 12:19
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 11, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.82.0 Issue or pull request that will be included in release 7.82.0 label Jun 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.82.0 Issue or pull request that will be included in release 7.82.0 size-XS team-perps Perps team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Android App crash during Learn the Basics of Perps

3 participants