Skip to content

Capture error in migration 105 if selectedAddress is not a string#23194

Merged
danjm merged 2 commits intodevelopfrom
migration-105-error-capture
Feb 27, 2024
Merged

Capture error in migration 105 if selectedAddress is not a string#23194
danjm merged 2 commits intodevelopfrom
migration-105-error-capture

Conversation

@danjm
Copy link
Copy Markdown
Contributor

@danjm danjm commented Feb 27, 2024

Description

We are seeing an error in prod that could only be explained if a migration fails. This PR adds some error handling to better detect and monitor one possible source of migration failure.

The prod error is:

TypeError getSelectedInternalAccount(ui/selectors/selectors.js)
Cannot read properties of undefined (reading 'selectedAccount')
https://metamask.sentry.io/issues/4999905586/?project=273505&query=is%3Aunresolved+release%3A11.10.0+is%3Anew&referrer=issue-stream&statsPeriod=7d&stream_index=9

Manual testing steps

Unit tests should pass. Also:

  1. Build this branch and install metamask
  2. During the onboarding flow, make sure to opt in to metametrics
  3. Run the following script in the background console
chrome.storage.local.get(({ data, meta }) => chrome.storage.local.set({ data: { ...data, PreferencesController: {selectedAddress: undefined} }, meta: {...meta, version: 104} }, () => { window.location.reload() }))

You should see a network request to sentry with state.PreferencesController?.selectedAddress is undefined in the payload

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

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.

@danjm danjm requested a review from a team as a code owner February 27, 2024 10:33
@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 INVALID-PR-TEMPLATE PR's body doesn't match template label Feb 27, 2024
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [6d2c0f4]
Page Load Metrics (2262 ± 197 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint11051325912560
domContentLoaded1096482412
load143427922262410197
domInteractive1096482412
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 193 Bytes (0.01%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.52%. Comparing base (d17c277) to head (6d2c0f4).
Report is 14 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #23194   +/-   ##
========================================
  Coverage    68.52%   68.52%           
========================================
  Files         1094     1094           
  Lines        43231    43233    +2     
  Branches     11524    11525    +1     
========================================
+ Hits         29620    29622    +2     
  Misses       13611    13611           

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

@danjm danjm added the team-extension-platform Extension Platform team label Feb 27, 2024
@danjm danjm merged commit 3ca675f into develop Feb 27, 2024
@danjm danjm deleted the migration-105-error-capture branch February 27, 2024 11:29
@github-actions github-actions bot locked and limited conversation to collaborators Feb 27, 2024
@metamaskbot metamaskbot added release-11.13.0 Issue or pull request that will be included in release 11.13.0 release-11.10.1 Issue or pull request that will be included in release 11.10.1 and removed release-11.13.0 Issue or pull request that will be included in release 11.13.0 labels Feb 27, 2024
@metamaskbot
Copy link
Copy Markdown
Collaborator

Missing release label release-11.10.1 on PR. Adding release label release-11.10.1 on PR and removing other release labels(release-11.13.0), as PR was cherry-picked in branch 11.10.1.

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

Labels

INVALID-PR-TEMPLATE PR's body doesn't match template release-11.10.1 Issue or pull request that will be included in release 11.10.1 team-extension-platform Extension Platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants