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 analytics try catch #2546

Merged
merged 5 commits into from
Apr 19, 2021
Merged
Show file tree
Hide file tree
Changes from 4 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
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Changelog

## Current Develop Branch
## v2.2.0 - Apr 21 2021
- [#2546](https://github.com/MetaMask/metamask-mobile/pull/2546): Fix analytics try catch
- [#2543](https://github.com/MetaMask/metamask-mobile/pull/2543): Only get nonce from the network if the feature is enabled
- [#2460](https://github.com/MetaMask/metamask-mobile/pull/2460): Feature/tx local state logs
- [#2540](https://github.com/MetaMask/metamask-mobile/pull/2540): bump v2.1.2
- [#2538](https://github.com/MetaMask/metamask-mobile/pull/2538): fix/connection change handler
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/WatchAssetRequest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ class WatchAssetRequest extends PureComponent {
onConfirm = async () => {
const { onConfirm, suggestedAssetMeta } = this.props;
const { AssetsController } = Engine.context;
AnalyticsV2.trackEvent(AnalyticsV2.ANALYTICS_EVENTS.TOKEN_ADDED, this.getAnalyticsParams());
await AssetsController.acceptWatchAsset(suggestedAssetMeta.id);
AnalyticsV2.trackEvent(AnalyticsV2.ANALYTICS_EVENTS.TOKEN_ADDED, this.getAnalyticsParams());
onConfirm && onConfirm();
};

Expand Down
14 changes: 7 additions & 7 deletions app/util/analyticsV2.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ export const ANALYTICS_EVENTS_V2 = {
* @param {Object} params
*/
export const trackEventV2 = (eventName, params) => {
try {
InteractionManager.runAfterInteractions(() => {
InteractionManager.runAfterInteractions(() => {
try {
if (!params) {
Analytics.trackEvent(eventName);
}
Expand All @@ -57,7 +57,7 @@ export const trackEventV2 = (eventName, params) => {
for (const key in params) {
const property = params[key];

if (typeof property === 'object') {
if (property && typeof property === 'object') {
if (property.anonymous) {
// Anonymous property - add only to anonymous params
anonymousParams[key] = property.value;
Expand All @@ -82,10 +82,10 @@ export const trackEventV2 = (eventName, params) => {
if (Object.keys(anonymousParams).length) {
Analytics.trackEventWithParameters(eventName, anonymousParams, true);
}
});
} catch (error) {
Logger.error(error, 'Error logging analytics');
}
} catch (error) {
Logger.error(error, 'Error logging analytics');
}
});
};

export default {
Expand Down
4 changes: 2 additions & 2 deletions ios/MetaMask.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@
CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMaskDebug.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 611;
CURRENT_PROJECT_VERSION = 612;
DEAD_CODE_STRIPPING = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 48XVW22RCG;
Expand Down Expand Up @@ -913,7 +913,7 @@
CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMask.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 611;
CURRENT_PROJECT_VERSION = 612;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 48XVW22RCG;
FRAMEWORK_SEARCH_PATHS = (
Expand Down