Skip to content

perf: Update FlashList to v2 cp-7.53.0#17789

Merged
owencraston merged 12 commits into
mainfrom
chore/update-flashlist-to-v2
Aug 7, 2025
Merged

perf: Update FlashList to v2 cp-7.53.0#17789
owencraston merged 12 commits into
mainfrom
chore/update-flashlist-to-v2

Conversation

@owencraston

@owencraston owencraston commented Jul 31, 2025

Copy link
Copy Markdown
Contributor

Description

  1. What is the reason for the change?
  • Performance regressions was found during release testing for 7.53.0
  • I believe the root cause of this issue is the following...
    • The initial state of the accounts controller is an empty array[]
    • FlashList uses the size of the list combined with the estimatedItemSize prop to draw the list
    • Since 7.51 and 7.53, we introduced multi chain accounts state 1 which changes how the accounts list is rendered. The size of elements is more dynamic (since now we render wallet name, account cell and footers). This combined with the fact that the initial list size starts at 0 was causing issues for the native android RecyclerListView.
    • This warning was logged in the console while testing:
    • WARN FlashList's rendered size is not usable. Either the height or width is too small (<2px). Please make sure that the parent view of the list has a valid size. FlashList will match the size of the parent.1
  • Why update to FlashList v2 instead of fixing the root cause of the issue?
    • Potential solution 1: Give the list a fixed height
      • This is not possible since the list lives in a bottom drawer popup that has a dynamic height
    • Potential Solution 2: Stop the useAccounts hook from returning an empty array as its initial state.
      • This is a much more difficult fix since that hook combines logic from over 7 selectors.
      • hooks are expected to have state updates and thus handling the dynamic size of the data is a normal react construct. If anything it was a bug in FlashList.
  1. What is the improvement/solution?
  • Update to FlashList v2 for the following reasons:
    • FlashList v2 handles the dynamic height and list size values without issues
    • Easier to use API (no more need for estimatedSize prop)
    • No more fixed height requirement
    • Fixes the scroll to selected account issue that was present since we migrated to FlashList v1

Resources

Changelog

CHANGELOG entry:

Related issues

Fixes: #17541

Manual testing steps

  1. Import an SRP with many accounts or create many accounts within your existing wallet
  2. open the account list
  3. the list should open within a reasonable amount of time and not require a touch event to complete the rendering cycle
  4. the list should scroll to the currently selected account

Screenshots/Recordings

Before

screen-20250723-154815.mp4

After

screen-20250805-171206.mp4

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.

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

@metamaskbot metamaskbot added the team-accounts-framework Accounts team label Jul 31, 2025
@socket-security

socket-security Bot commented Jul 31, 2025

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​shopify/​flash-list@​1.8.0 ⏵ 2.0.1100 +110098 +6100 +1100

View full report

@github-actions

github-actions Bot commented Jul 31, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: d7e46e98a81e653c31f9aa5a8477863858cddab0
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/d119e7e7-01a4-4dd4-a82c-12085f2e1898

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

@owencraston owencraston force-pushed the chore/update-flashlist-to-v2 branch 4 times, most recently from c5fc3f5 to 80f3306 Compare August 5, 2025 18:37
@owencraston owencraston changed the title chore: Update FlashList to v2 perf: Update FlashList to v2 cp-7.53.0 Aug 5, 2025
@github-actions

github-actions Bot commented Aug 5, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 80f33060d6ac125d2877ccd4f0542a906fc107d4
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/3a0e63de-a5dd-4763-9acb-92ea771c630d

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

@owencraston owencraston added the No QA Needed Apply this label when your PR does not need any QA effort. label Aug 5, 2025
@owencraston owencraston force-pushed the chore/update-flashlist-to-v2 branch from 80f3306 to ce4969c Compare August 5, 2025 20:09
@owencraston owencraston force-pushed the chore/update-flashlist-to-v2 branch from d56c35e to 492f37e Compare August 5, 2025 20:50
@github-actions

github-actions Bot commented Aug 5, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 492f37ed9fd7f0aea4105af5875961f3921a89a8
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/5a0c0ef9-cb14-4a3d-8397-5bbfab9a0cc9

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

@owencraston owencraston marked this pull request as ready for review August 5, 2025 21:16
@owencraston owencraston requested review from a team as code owners August 5, 2025 21:16
@owencraston owencraston requested a review from a team August 5, 2025 21:16

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We no longer need to pass in a fixed height to the parent so we can remove this. The account list will now automatically take up the height it needs to render the accounts on the visible portion of the screen.

@github-actions

github-actions Bot commented Aug 5, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: e93371e6b7c98c36edadb4e5b2ae03c8a0e20dd9
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/2a488e72-8038-498b-ab90-3120d8b637b6

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 commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

🔄🔄🔄 pr_smoke_e2e_pipeline started on Bitrise...🔄🔄🔄

Commit hash: 887c7ff
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/e525c445-5483-4e6b-a08f-37ff469a8f6a

Note

  • This comment will auto-update when build completes
  • 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

@github-actions

github-actions Bot commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 2c1088c
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/70446309-97da-4375-b535-46395fd48830

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

@nickewansmith nickewansmith left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2025

Copy link
Copy Markdown

@Cal-L Cal-L left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@owencraston owencraston enabled auto-merge August 7, 2025 03:23
@owencraston owencraston added this pull request to the merge queue Aug 7, 2025
Merged via the queue into main with commit 6b01ea5 Aug 7, 2025
62 of 64 checks passed
@owencraston owencraston deleted the chore/update-flashlist-to-v2 branch August 7, 2025 03:42
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 7, 2025
@github-actions github-actions Bot added the needs-validation Post merge validation label Aug 7, 2025
@metamaskbot metamaskbot added the release-7.54.0 Issue or pull request that will be included in release 7.54.0 label Aug 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

needs-validation Post merge validation No QA Needed Apply this label when your PR does not need any QA effort. release-7.54.0 Issue or pull request that will be included in release 7.54.0 team-accounts-framework Accounts team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Performance degradation Android Accounts list