Skip to content

Commit fe301fa

Browse files
authored
fix: fix sentry logs noisy (#31039)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** fix migration 134.1 , because it's causing some noisy error logs <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/31039?quickstart=1) ## **Related issues** Fixes: #30441 ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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.
1 parent 7273f1b commit fe301fa

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

app/scripts/migrations/134.1.test.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,14 @@ describe(`Migration ${version}`, () => {
249249
meta: { version: 0 },
250250
data: {
251251
AccountsController: {
252-
internalAccounts: { selectedAccount: '0x123' },
252+
internalAccounts: {
253+
selectedAccount: '0x123',
254+
accounts: {
255+
'0x123': {
256+
address: '0x123',
257+
},
258+
},
259+
},
253260
},
254261
NetworkController: {
255262
selectedNetworkClientId: 'mainnet',
@@ -270,7 +277,7 @@ describe(`Migration ${version}`, () => {
270277
};
271278

272279
const result = await migrate(originalState);
273-
expect(sentryCaptureExceptionMock).toHaveBeenCalled();
280+
expect(sentryCaptureExceptionMock).not.toHaveBeenCalled();
274281
expect(result.data).toEqual(originalState.data);
275282
});
276283

app/scripts/migrations/134.1.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,6 @@ function transformState(
231231

232232
const accountTokens = allTokensForChain[selectedAccountAddress];
233233
if (!Array.isArray(accountTokens)) {
234-
global.sentry?.captureException?.(
235-
new Error(
236-
`Migration ${version}: allTokens["${currentChainId}"]["${selectedAccountAddress}"] is not an array; skipping migration.`,
237-
),
238-
);
239234
return state;
240235
}
241236

0 commit comments

Comments
 (0)