Skip to content

Conversation

@tommasini
Copy link
Contributor

@tommasini tommasini commented Sep 5, 2025

Description

Problem:
LockScreen component only triggered biometrics when AppState changed
During rapid background/foreground cycles during login, the component could mount when the app was already in 'active' state
Since no AppState change occurs (app is already active), the listener never fires
User sees FoxLoader indefinitely without biometrics being triggered

Solution:
Simplified the LockScreen component by replacing laggy Lottie animations with a static FoxLoader component to improve performance and user experience.

Changes Made

  • Replaced laggy Lottie animations (wordmarkLight, wordmarkDark) with static FoxLoader component
  • Removed animation-related styling and positioning code that's no longer needed
  • Cleaned up unused state (ready state, animation refs, opacity Animated.Value)
  • Removed unnecessary Redux connection and theme imports
  • Simplified component structure while preserving authentication functionality
  • Handled race condition when the app state already changed before the listener got defined.

Impact

  • Improved performance by eliminating laggy animations
  • Better user experience with consistent, responsive loading indicator
  • Reduced bundle size by removing animation assets (to do)
  • Authentication functionality remains unchanged
  • No more freezing screen at the diamong due to race condition

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Screen.Recording.2025-09-05.at.18.28.28.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.

@tommasini tommasini requested a review from a team as a code owner September 5, 2025 18:32
@tommasini tommasini added needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) team-mobile-platform Mobile Platform team Run Smoke E2E labels Sep 5, 2025
@github-project-automation github-project-automation bot moved this to Needs dev review in PR review queue Sep 5, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2025

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.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 272dfa1
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/177f26c9-3bb7-46c4-accf-d0c9b17fde05

Note

  • You can rerun any failed steps by opening the Bitrise build, tapping Rebuild on the upper right then Rebuild unsuccessful Workflows
  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@github-actions github-actions bot added the size-M label Sep 5, 2025
cursor[bot]

This comment was marked as outdated.

@github-actions github-actions bot added size-L and removed size-M labels Sep 12, 2025
@github-actions github-actions bot added size-XL and removed size-L labels Sep 12, 2025
@sonarqubecloud
Copy link


// Trigger biometrics immediately if app is already active
// This handles cases where component mounts during rapid background/foreground cycles
if (AppState.currentState === 'active') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wanted to note that this is the patch

Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Cal-L Cal-L enabled auto-merge September 12, 2025 22:41
Copy link
Contributor

@vinnyhoward vinnyhoward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix and clean up! LGTM

@Cal-L Cal-L added this pull request to the merge queue Sep 12, 2025
@github-project-automation github-project-automation bot moved this from Needs dev review to Review finalised - Ready to be merged in PR review queue Sep 12, 2025
Merged via the queue into main with commit 70ef4d6 Sep 12, 2025
87 of 89 checks passed
@Cal-L Cal-L deleted the chore/fix-animation-lock-screen branch September 12, 2025 23:11
@github-project-automation github-project-automation bot moved this from Review finalised - Ready to be merged to Merged, Closed or Archived in PR review queue Sep 12, 2025
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Sep 12, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Sep 12, 2025
@metamaskbot metamaskbot added the release-7.56.0 Issue or pull request that will be included in release 7.56.0 label Sep 12, 2025
@tommasini tommasini linked an issue Sep 15, 2025 that may be closed by this pull request
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.56.0 Issue or pull request that will be included in release 7.56.0 size-XL team-mobile-platform Mobile Platform team

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[Bug]: MetaMask app freezes when switching back from another app

5 participants