Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bump accounts controller and migration to fix undefined selectedAccount #26573

Merged
merged 7 commits into from
Aug 22, 2024

Conversation

montelaidev
Copy link
Contributor

@montelaidev montelaidev commented Aug 21, 2024

Description

This PR bumps the AccountsController and introduces a new migration. The updateAccounts methods from the AccountsController now checks if the selectedAccount is undefined and recovers from this. The migration updates the selectedAccount values that are not defined.

Open in GitHub Codespaces

Related issues

Fixes: #26377

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

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.

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.

Copy link

socket-security bot commented Aug 21, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@metamask/[email protected] None 0 391 kB metamaskbot
npm/@metamask/[email protected] None 0 250 kB metamaskbot

🚮 Removed packages: npm/@metamask/[email protected]), npm/@metamask/[email protected])

View full report↗︎

@montelaidev
Copy link
Contributor Author

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

Policies updated

@montelaidev montelaidev marked this pull request as ready for review August 21, 2024 16:31
@montelaidev montelaidev requested review from a team as code owners August 21, 2024 16:31
Copy link

codecov bot commented Aug 21, 2024

Codecov Report

Attention: Patch coverage is 95.65217% with 1 line in your changes missing coverage. Please review.

Project coverage is 70.05%. Comparing base (590f0a9) to head (e6a2d32).
Report is 19 commits behind head on develop.

Files Patch % Lines
...nents/multichain/pages/connections/connections.tsx 88.89% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #26573      +/-   ##
===========================================
+ Coverage    70.02%   70.05%   +0.02%     
===========================================
  Files         1406     1411       +5     
  Lines        49076    49219     +143     
  Branches     13725    13757      +32     
===========================================
+ Hits         34364    34476     +112     
- Misses       14712    14743      +31     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@metamaskbot
Copy link
Collaborator

Builds ready [7d5955c]
Page Load Metrics (76 ± 7 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint74124101147
domContentLoaded509572136
load5010276147
domInteractive9532894
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 48.78 KiB (1.37%)
  • ui: -5 Bytes (-0.00%)
  • common: 26.6 KiB (0.32%)

@montelaidev montelaidev changed the title fix: 26377 fix: bump accounts controller and migration to fix undefined selectedAccount Aug 21, 2024
Copy link
Member

@gantunesr gantunesr left a comment

Choose a reason for hiding this comment

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

Looks like, left some minor comments

ui/components/multichain/pages/connections/connections.tsx Outdated Show resolved Hide resolved
ui/selectors/selectors.types.ts Outdated Show resolved Hide resolved
Copy link

sonarcloud bot commented Aug 22, 2024

@metamaskbot
Copy link
Collaborator

Builds ready [e6a2d32]
Page Load Metrics (82 ± 18 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint652891185225
domContentLoaded39201793919
load46201823818
domInteractive98731189
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 48.78 KiB (1.37%)
  • ui: -5 Bytes (-0.00%)
  • common: 26.6 KiB (0.32%)

@@ -24,7 +25,7 @@ export const SnapAccountCard = ({
const account = mergedAccounts.find(
Copy link
Contributor

Choose a reason for hiding this comment

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

Adding a note here as a TODO for us to remove the need of mergeAccounts

@montelaidev montelaidev merged commit 759b92e into develop Aug 22, 2024
78 checks passed
@montelaidev montelaidev deleted the fix/26377 branch August 22, 2024 15:42
@github-actions github-actions bot locked and limited conversation to collaborators Aug 22, 2024
@metamaskbot metamaskbot added the release-12.5.0 Issue or pull request that will be included in release 12.5.0 label Aug 22, 2024
@gauthierpetetin gauthierpetetin added release-12.4.0 Issue or pull request that will be included in release 12.4.0 and removed release-12.5.0 Issue or pull request that will be included in release 12.5.0 labels Sep 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.4.0 Issue or pull request that will be included in release 12.4.0 team-accounts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: Account Id [UUID] not found
5 participants