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

feat: add sentry error logging to account syncing erroneous situations #29692

Merged
merged 4 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -1631,7 +1631,12 @@ export default class MetamaskController extends EventEmitter {
},
});
},
onAccountSyncErroneousSituation: (profileId, situationMessage) => {
onAccountSyncErroneousSituation: (
profileId,
situationMessage,
sentryContext,
) => {
captureException(new Error(situationMessage), sentryContext);
Prithpal-Sooriya marked this conversation as resolved.
Show resolved Hide resolved
this.metaMetricsController.trackEvent({
category: MetaMetricsEventCategory.ProfileSyncing,
event: MetaMetricsEventName.AccountsSyncErroneousSituation,
Expand Down
52 changes: 30 additions & 22 deletions lavamoat/browserify/beta/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@
"@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils": {
"packages": {
"@metamask/utils>@metamask/superstruct": true,
"@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": true
"@metamask/keyring-controller>@metamask/utils": true
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see any changes here, seems to be a lavamoat policy re-ordering.

}
},
"@metamask/signature-controller>@metamask/eth-sig-util>@metamask/abi-utils": {
Expand Down Expand Up @@ -1160,7 +1160,7 @@
"packages": {
"@ethereumjs/tx>@ethereumjs/util": true,
"@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils": true,
"@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/utils": true,
"@metamask/keyring-controller>@metamask/utils": true,
"@metamask/utils>@scure/base": true,
"browserify>buffer": true,
"@ethereumjs/tx>ethereum-cryptography": true,
Expand Down Expand Up @@ -1377,6 +1377,14 @@
"@metamask/keyring-api>bech32": true
}
},
"@metamask/profile-sync-controller>@metamask/keyring-api": {
"packages": {
"@metamask/keyring-api>@metamask/keyring-utils": true,
"@metamask/utils>@metamask/superstruct": true,
"@metamask/profile-sync-controller>@metamask/keyring-api>@metamask/utils": true,
"@metamask/keyring-api>bech32": true
}
},
Comment on lines +1380 to +1387
Copy link
Contributor

@Prithpal-Sooriya Prithpal-Sooriya Jan 14, 2025

Choose a reason for hiding this comment

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

The new version of this controller updates the keyring API (v 13.0.0), which includes these underlying changes.

"@metamask/keyring-controller": {
"packages": {
"@ethereumjs/tx>@ethereumjs/util": true,
Expand All @@ -1385,7 +1393,7 @@
"@metamask/keyring-controller>@metamask/eth-hd-keyring": true,
"@metamask/keyring-controller>@metamask/eth-sig-util": true,
"@metamask/keyring-controller>@metamask/eth-simple-keyring": true,
"@metamask/utils": true,
"@metamask/keyring-controller>@metamask/utils": true,
"@metamask/name-controller>async-mutex": true,
"@metamask/keyring-controller>ethereumjs-wallet": true
}
Expand Down Expand Up @@ -1629,7 +1637,7 @@
},
"packages": {
"@metamask/base-controller": true,
"@metamask/keyring-api": true,
"@metamask/profile-sync-controller>@metamask/keyring-api": true,
"@metamask/keyring-controller": true,
"@metamask/network-controller": true,
"@metamask/profile-sync-controller>@noble/ciphers": true,
Expand Down Expand Up @@ -1947,7 +1955,7 @@
"semver": true
}
},
"@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": {
"@metamask/signature-controller>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
Expand All @@ -1962,7 +1970,7 @@
"semver": true
}
},
"@metamask/signature-controller>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": {
"@metamask/browser-passworder>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
Expand All @@ -1977,7 +1985,7 @@
"semver": true
}
},
"@metamask/browser-passworder>@metamask/utils": {
"@metamask/eth-token-tracker>@metamask/eth-block-tracker>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
Expand All @@ -1992,7 +2000,7 @@
"semver": true
}
},
"@metamask/eth-token-tracker>@metamask/eth-block-tracker>@metamask/utils": {
"@metamask/network-controller>@metamask/eth-block-tracker>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
Expand All @@ -2007,7 +2015,7 @@
"semver": true
}
},
"@metamask/network-controller>@metamask/eth-block-tracker>@metamask/utils": {
"@metamask/keyring-controller>@metamask/eth-hd-keyring>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
Expand All @@ -2022,7 +2030,7 @@
"semver": true
}
},
"@metamask/keyring-controller>@metamask/eth-hd-keyring>@metamask/utils": {
"@metamask/network-controller>@metamask/eth-json-rpc-infura>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
Expand All @@ -2037,7 +2045,7 @@
"semver": true
}
},
"@metamask/network-controller>@metamask/eth-json-rpc-infura>@metamask/utils": {
"@metamask/eth-json-rpc-middleware>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
Expand All @@ -2052,7 +2060,7 @@
"semver": true
}
},
"@metamask/eth-json-rpc-middleware>@metamask/utils": {
"@metamask/eth-sig-util>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
Expand All @@ -2067,7 +2075,7 @@
"semver": true
}
},
"@metamask/eth-sig-util>@metamask/utils": {
"@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
Expand All @@ -2082,7 +2090,7 @@
"semver": true
}
},
"@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": {
"@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
Expand All @@ -2097,7 +2105,7 @@
"semver": true
}
},
"@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/utils": {
"@metamask/eth-trezor-keyring>@metamask/eth-sig-util>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
Expand All @@ -2112,7 +2120,7 @@
"semver": true
}
},
"@metamask/eth-trezor-keyring>@metamask/eth-sig-util>@metamask/utils": {
"@metamask/signature-controller>@metamask/eth-sig-util>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
Expand All @@ -2127,7 +2135,7 @@
"semver": true
}
},
"@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/utils": {
"@metamask/keyring-controller>@metamask/eth-simple-keyring>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
Expand All @@ -2142,7 +2150,7 @@
"semver": true
}
},
"@metamask/signature-controller>@metamask/eth-sig-util>@metamask/utils": {
"@metamask/eth-snap-keyring>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
Expand All @@ -2157,7 +2165,7 @@
"semver": true
}
},
"@metamask/keyring-controller>@metamask/eth-simple-keyring>@metamask/utils": {
"@metamask/json-rpc-engine>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
Expand All @@ -2172,7 +2180,7 @@
"semver": true
}
},
"@metamask/eth-snap-keyring>@metamask/utils": {
"@metamask/keyring-api>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
Expand All @@ -2187,7 +2195,7 @@
"semver": true
}
},
"@metamask/json-rpc-engine>@metamask/utils": {
"@metamask/profile-sync-controller>@metamask/keyring-api>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
Expand All @@ -2202,7 +2210,7 @@
"semver": true
}
},
"@metamask/keyring-api>@metamask/utils": {
"@metamask/keyring-controller>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
Expand Down
Loading
Loading