Skip to content

Commit

Permalink
Merge branch 'main' into release/7.37.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sethkfman authored Dec 11, 2024
2 parents 9e56ebc + d49e8b6 commit cdecdd3
Show file tree
Hide file tree
Showing 9 changed files with 406 additions and 121 deletions.
26 changes: 3 additions & 23 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
## Current Main Branch

## 7.37.0 - Nov 28, 2024

### Added
- [#12091](https://github.com/MetaMask/metamask-mobile/pull/12091): feat: 2020 Add a performance test for iOS in Bitrise (#12091)
- [#12148](https://github.com/MetaMask/metamask-mobile/pull/12148): feat: Enable smart transactions for new users (#12148)
Expand All @@ -15,16 +14,14 @@
- [#12393](https://github.com/MetaMask/metamask-mobile/pull/12393): feat: Creating data tree for signed type V1 signatures (#12393)
- [#12160](https://github.com/MetaMask/metamask-mobile/pull/12160): feat: Integrate NFT api to display image & names in simulations includes `erc721`s (#12160)
- [#12324](https://github.com/MetaMask/metamask-mobile/pull/12324): feat: confirmation re-designs add basic page for types sign V1 signature request (#12324)
- [#12452](https://github.com/MetaMask/metamask-mobile/pull/12452): [chore] Merge in feat: updated staking events to use withMetaMetrics helper (#12337) (#12452)
- [#11424](https://github.com/MetaMask/metamask-mobile/pull/11424): feat: add workflow for updating automated test results in TestRail (#11424)
- [#12359](https://github.com/MetaMask/metamask-mobile/pull/12359): feat: v7.35.1 (#12359)
- [#12167](https://github.com/MetaMask/metamask-mobile/pull/12167): feat: v7.35.0 (#12167)
- [#12337](https://github.com/MetaMask/metamask-mobile/pull/12337): feat: updated staking events to use withMetaMetrics helper (#12337)
- [#12363](https://github.com/MetaMask/metamask-mobile/pull/12363): feat: add PooledStaking slice for managing staking state (#12363)
- [#12398](https://github.com/MetaMask/metamask-mobile/pull/12398): feat: limit input digits to 12 in useInputHandler (#12398)
- [#12344](https://github.com/MetaMask/metamask-mobile/pull/12344): feat: upgrade assets controllers to v44 (#12344)
- [#12340](https://github.com/MetaMask/metamask-mobile/pull/12340): feat: upgrade assets controllers to version 43 (#12340)
- [#12270](https://github.com/MetaMask/metamask-mobile/pull/12270): feat: upgrade assets controllers to 42 with multichain token rates (#12270)
- [#12452](https://github.com/MetaMask/metamask-mobile/pull/12452): feat: updated staking events to use withMetaMetrics helper (#12337) (#12452)

### Changed
- [#12356](https://github.com/MetaMask/metamask-mobile/pull/12356): chore: Remove unnecessary event prop (#12356)
Expand All @@ -41,7 +38,6 @@
- [#12415](https://github.com/MetaMask/metamask-mobile/pull/12415): chore: Cherry pick 2506358 (merge in trackEvent work) (#12415)
- [#12238](https://github.com/MetaMask/metamask-mobile/pull/12238): chore: update codeowners (#12238)
- [#12416](https://github.com/MetaMask/metamask-mobile/pull/12416): chore: Chore/update accounts controller messenger code owner (#12416)
- [#12313](https://github.com/MetaMask/metamask-mobile/pull/12313): fix: Remove run all tests section (#12313)
- [#12366](https://github.com/MetaMask/metamask-mobile/pull/12366): chore: #12184 MVP split engine file (#12366)
- [#12362](https://github.com/MetaMask/metamask-mobile/pull/12362): chore: Unit tests for tags approval controller undefined (#12362)
- [#12343](https://github.com/MetaMask/metamask-mobile/pull/12343): chore: Cherry pick f35d583 (#12343)
Expand All @@ -50,13 +46,14 @@
- [#12334](https://github.com/MetaMask/metamask-mobile/pull/12334): chore: updating filter icon (#12334)

### Fixed
- [#12313](https://github.com/MetaMask/metamask-mobile/pull/12313): fix: Remove run all tests section (#12313)
- [#12489](https://github.com/MetaMask/metamask-mobile/pull/12489): fix: replace end of navigation init and UIStartup span (#12489)
- [#12331](https://github.com/MetaMask/metamask-mobile/pull/12331): fix: tags pending approvals receiving undefined (#12331)
- [#10486](https://github.com/MetaMask/metamask-mobile/pull/10486): fix: limit ReactNativeWebview message size (#10486)
- [#12478](https://github.com/MetaMask/metamask-mobile/pull/12478): fix: incorrect event source in analytics and connection (#12478)
- [#10786](https://github.com/MetaMask/metamask-mobile/pull/10786): fix: added icon to walletconnect metadata (#10786)
- [#12455](https://github.com/MetaMask/metamask-mobile/pull/12455): fix: gas fee edit from swaps (#12455)
- [#12370](https://github.com/MetaMask/metamask-mobile/pull/12370): "fix: Fix copy of ""Network fee"" on approval (#12370)"
- [#12370](https://github.com/MetaMask/metamask-mobile/pull/12370): fix: Fix copy of ""Network fee"" on approval (#12370)
- [#12273](https://github.com/MetaMask/metamask-mobile/pull/12273): fix: Disable confirm button if `transactionMeta` is undefined (#12273)
- [#12367](https://github.com/MetaMask/metamask-mobile/pull/12367): fix: app crashing after send or swap (#12367)
- [#12446](https://github.com/MetaMask/metamask-mobile/pull/12446): fix: update wallet_addEthereumChain.js with correct MetricsEventBuilder (#12446)
Expand All @@ -67,23 +64,6 @@
- [#12371](https://github.com/MetaMask/metamask-mobile/pull/12371): fix: fix patch missing variable sentry error (#12371)
- [#12375](https://github.com/MetaMask/metamask-mobile/pull/12375): fix: breaking selector due to missing controller state (#12375)

### Other
- [#12374](https://github.com/MetaMask/metamask-mobile/pull/12374): perf: Remove costly reduce operation for generating Engine context (#12374)
- [#12345](https://github.com/MetaMask/metamask-mobile/pull/12345): chore: bump walletconnect/* deps (#12345)
- [#Daniel](Daniel): "feat: Support returning a txHash asap
- [#EtherWizard33](EtherWizard33): "feat: non-permissioned networks
- [#12474](https://github.com/MetaMask/metamask-mobile/pull/12474): chore: bump `@metamask/signature-controller` to `^22.0.0` (#12474)
- [#12472](https://github.com/MetaMask/metamask-mobile/pull/12472): chore: bump `@metamask/preferences-controller` to `^14.0.0` (#12472)
- [#Michele Esposito](Michele Esposito): "chore(deps): bump `@metamask/{swaps
- [#12003](https://github.com/MetaMask/metamask-mobile/pull/12003): build(deps): bump `@metamask/smart-transaction-controller` to `^14.0.0` (#12003)
- [#12004](https://github.com/MetaMask/metamask-mobile/pull/12004): build(deps): bump `@metamask/selected-network-controller` to `^18.0.2` (#12004)
- [#12471](https://github.com/MetaMask/metamask-mobile/pull/12471): chore(runway): cherry-pick fix: gas fee edit from swaps (#12471)
- [#12453](https://github.com/MetaMask/metamask-mobile/pull/12453): chore(runway): cherry-pick fix: update wallet_addEthereumChain.js with correct MetricsEventBuilder (#12453)
- [#12361](https://github.com/MetaMask/metamask-mobile/pull/12361): chore(runway): cherry-pick fix: tags pending approvals receiving undefined (#12361)
- [#12335](https://github.com/MetaMask/metamask-mobile/pull/12335): chore: cherrypick do not show staked eth balance when balance is zero on homepage or asset detail (#12335)
- [#12414](https://github.com/MetaMask/metamask-mobile/pull/12414): chore(runway): cherry-pick fix: breaking selector due to missing controller state (#12414)
- [#12349](https://github.com/MetaMask/metamask-mobile/pull/12349): fix: Remove duplicate notifications controllers entries in `EngineService` (#12349)

## 7.36.0 - Nov 15, 2024
### Added
- [#12015](https://github.com/MetaMask/metamask-mobile/pull/12015): feat: 1957 crash screen redesign (#12015)
Expand Down
18 changes: 16 additions & 2 deletions app/components/Nav/Main/RootRPCMethodsUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,20 +234,34 @@ const RootRPCMethodsUI = (props) => {
);

const parameters = {
...analyticsParams,
time_to_mine: timeToMine,
estimated_vs_used_gasRatio: estimatedVsUsedGasRatio,
quote_vs_executionRatio: quoteVsExecutionRatio,
token_to_amount_received: tokenToAmountReceived.toString(),
is_smart_transaction: props.shouldUseSmartTransaction,
...smartTransactionMetricsProperties,
available_quotes: analyticsParams.available_quotes,
best_quote_source: analyticsParams.best_quote_source,
chain_id: analyticsParams.chain_id,
custom_slippage: analyticsParams.custom_slippage,
network_fees_USD: analyticsParams.network_fees_USD,
other_quote_selected: analyticsParams.other_quote_selected,
request_type: analyticsParams.request_type,
token_from: analyticsParams.token_from,
token_to: analyticsParams.token_to,
};
const sensitiveParameters = {
token_from_amount: analyticsParams.token_from_amount,
token_to_amount: analyticsParams.token_to_amount,
network_fees_ETH: analyticsParams.network_fees_ETH,
};

Logger.log('Swaps', 'Sending metrics event', event);

trackEvent(
createEventBuilder(event)
.addSensitiveProperties({ ...parameters })
.addProperties({ ...parameters })
.addSensitiveProperties({ ...sensitiveParameters })
.build(),
);
} catch (e) {
Expand Down
18 changes: 16 additions & 2 deletions app/components/UI/Navbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1740,9 +1740,16 @@ export function getSwapsQuotesNavbar(navigation, route, themeColors) {
MetaMetricsEvents.QUOTES_REQUEST_CANCELLED,
)
.addProperties({
...trade,
token_from: trade.token_from,
token_to: trade.token_to,
request_type: trade.request_type,
custom_slippage: trade.custom_slippage,
chain_id: trade.chain_id,
responseTime: new Date().getTime() - quoteBegin,
})
.addSensitiveProperties({
token_from_amount: trade.token_from_amount,
})
.build(),
);
}
Expand All @@ -1759,9 +1766,16 @@ export function getSwapsQuotesNavbar(navigation, route, themeColors) {
MetaMetricsEvents.QUOTES_REQUEST_CANCELLED,
)
.addProperties({
...trade,
token_from: trade.token_from,
token_to: trade.token_to,
request_type: trade.request_type,
custom_slippage: trade.custom_slippage,
chain_id: trade.chain_id,
responseTime: new Date().getTime() - quoteBegin,
})
.addSensitiveProperties({
token_from_amount: trade.token_from_amount,
})
.build(),
);
}
Expand Down
117 changes: 68 additions & 49 deletions app/components/UI/Swaps/QuotesView.js
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ function SwapsQuotesView({

trackEvent(
createEventBuilder(MetaMetricsEvents.GAS_FEES_CHANGED)
.addSensitiveProperties(parameters)
.addProperties(parameters)
.build(),
);
},
Expand Down Expand Up @@ -871,15 +871,7 @@ function SwapsQuotesView({
const parameters = {
account_type: getAddressAccountType(selectedAddress),
token_from: sourceToken.symbol,
token_from_amount: fromTokenMinimalUnitString(
sourceAmount,
sourceToken.decimals,
),
token_to: destinationToken.symbol,
token_to_amount: fromTokenMinimalUnitString(
selectedQuote.destinationAmount,
destinationToken.decimals,
),
request_type: hasEnoughTokenBalance ? 'Order' : 'Quote',
slippage,
custom_slippage: slippage !== AppConstants.SWAPS.DEFAULT_SLIPPAGE,
Expand All @@ -895,9 +887,20 @@ function SwapsQuotesView({
chain_id: getDecimalChainId(chainId),
is_smart_transaction: shouldUseSmartTransaction,
};
const sensitiveParameters = {
token_from_amount: fromTokenMinimalUnitString(
sourceAmount,
sourceToken.decimals,
),
token_to_amount: fromTokenMinimalUnitString(
selectedQuote.destinationAmount,
destinationToken.decimals,
),
};
trackEvent(
createEventBuilder(MetaMetricsEvents.SWAP_STARTED)
.addSensitiveProperties(parameters)
.addProperties(parameters)
.addSensitiveProperties(sensitiveParameters)
.build(),
);
},
Expand Down Expand Up @@ -1157,15 +1160,7 @@ function SwapsQuotesView({

const parameters = {
token_from: sourceToken.symbol,
token_from_amount: fromTokenMinimalUnitString(
sourceAmount,
sourceToken.decimals,
),
token_to: destinationToken.symbol,
token_to_amount: fromTokenMinimalUnitString(
selectedQuote.destinationAmount,
destinationToken.decimals,
),
request_type: hasEnoughTokenBalance ? 'Order' : 'Quote',
slippage,
custom_slippage: slippage !== AppConstants.SWAPS.DEFAULT_SLIPPAGE,
Expand All @@ -1181,9 +1176,20 @@ function SwapsQuotesView({
custom_spend_limit_amount: currentAmount,
chain_id: getDecimalChainId(chainId),
};
const sensitiveParameters = {
token_from_amount: fromTokenMinimalUnitString(
sourceAmount,
sourceToken.decimals,
),
token_to_amount: fromTokenMinimalUnitString(
selectedQuote.destinationAmount,
destinationToken.decimals,
),
};
trackEvent(
createEventBuilder(MetaMetricsEvents.EDIT_SPEND_LIMIT_OPENED)
.addSensitiveProperties(parameters)
.addProperties(parameters)
.addSensitiveProperties(sensitiveParameters)
.build(),
);
}, [
Expand All @@ -1209,15 +1215,7 @@ function SwapsQuotesView({
if (!selectedQuote || !selectedQuoteValue) return;
const parameters = {
token_from: sourceToken.symbol,
token_from_amount: fromTokenMinimalUnitString(
sourceAmount,
sourceToken.decimals,
),
token_to: destinationToken.symbol,
token_to_amount: fromTokenMinimalUnitString(
selectedQuote.destinationAmount,
destinationToken.decimals,
),
request_type: hasEnoughTokenBalance ? 'Order' : 'Quote',
slippage,
custom_slippage: slippage !== AppConstants.SWAPS.DEFAULT_SLIPPAGE,
Expand All @@ -1232,9 +1230,20 @@ function SwapsQuotesView({
available_quotes: allQuotes.length,
chain_id: getDecimalChainId(chainId),
};
const sensitiveParameters = {
token_from_amount: fromTokenMinimalUnitString(
sourceAmount,
sourceToken.decimals,
),
token_to_amount: fromTokenMinimalUnitString(
selectedQuote.destinationAmount,
destinationToken.decimals,
),
};
trackEvent(
createEventBuilder(MetaMetricsEvents.QUOTES_RECEIVED)
.addSensitiveProperties(parameters)
.addProperties(parameters)
.addSensitiveProperties(sensitiveParameters)
.build(),
);
}, [
Expand All @@ -1258,15 +1267,7 @@ function SwapsQuotesView({
toggleQuotesModal();
const parameters = {
token_from: sourceToken.symbol,
token_from_amount: fromTokenMinimalUnitString(
sourceAmount,
sourceToken.decimals,
),
token_to: destinationToken.symbol,
token_to_amount: fromTokenMinimalUnitString(
selectedQuote.destinationAmount,
destinationToken.decimals,
),
request_type: hasEnoughTokenBalance ? 'Order' : 'Quote',
slippage,
custom_slippage: slippage !== AppConstants.SWAPS.DEFAULT_SLIPPAGE,
Expand All @@ -1281,10 +1282,21 @@ function SwapsQuotesView({
available_quotes: allQuotes.length,
chain_id: getDecimalChainId(chainId),
};
const sensitiveParameters = {
token_from_amount: fromTokenMinimalUnitString(
sourceAmount,
sourceToken.decimals,
),
token_to_amount: fromTokenMinimalUnitString(
selectedQuote.destinationAmount,
destinationToken.decimals,
),
};

trackEvent(
createEventBuilder(MetaMetricsEvents.ALL_AVAILABLE_QUOTES_OPENED)
.addSensitiveProperties(parameters)
.addProperties(parameters)
.addSensitiveProperties(sensitiveParameters)
.build(),
);
}, [
Expand All @@ -1308,16 +1320,18 @@ function SwapsQuotesView({
(error) => {
const data = {
token_from: sourceToken.symbol,
token_from_amount: fromTokenMinimalUnitString(
sourceAmount,
sourceToken.decimals,
),
token_to: destinationToken.symbol,
request_type: hasEnoughTokenBalance ? 'Order' : 'Quote',
slippage,
custom_slippage: slippage !== AppConstants.SWAPS.DEFAULT_SLIPPAGE,
chain_id: getDecimalChainId(chainId),
};
const sensitiveData = {
token_from_amount: fromTokenMinimalUnitString(
sourceAmount,
sourceToken.decimals,
),
};
if (error?.key === swapsUtils.SwapsError.QUOTES_EXPIRED_ERROR) {
const parameters = {
...data,
Expand All @@ -1326,7 +1340,8 @@ function SwapsQuotesView({

trackEvent(
createEventBuilder(MetaMetricsEvents.QUOTES_TIMED_OUT)
.addSensitiveProperties(parameters)
.addProperties(parameters)
.addSensitiveProperties(sensitiveData)
.build(),
);
} else if (
Expand All @@ -1335,7 +1350,8 @@ function SwapsQuotesView({
const parameters = { ...data };
trackEvent(
createEventBuilder(MetaMetricsEvents.NO_QUOTES_AVAILABLE)
.addSensitiveProperties(parameters)
.addProperties(parameters)
.addSensitiveProperties(sensitiveData)
.build(),
);
} else {
Expand Down Expand Up @@ -1606,22 +1622,25 @@ function SwapsQuotesView({
setTrackedRequestedQuotes(true);
const data = {
token_from: sourceToken.symbol,
token_from_amount: fromTokenMinimalUnitString(
sourceAmount,
sourceToken.decimals,
),
token_to: destinationToken.symbol,
request_type: hasEnoughTokenBalance ? 'Order' : 'Quote',
custom_slippage: slippage !== AppConstants.SWAPS.DEFAULT_SLIPPAGE,
chain_id: getDecimalChainId(chainId),
};
navigation.setParams({ requestedTrade: data });
const sensitiveData = {
token_from_amount: fromTokenMinimalUnitString(
sourceAmount,
sourceToken.decimals,
),
};
navigation.setParams({ requestedTrade: { ...data, ...sensitiveData } });
navigation.setParams({ selectedQuote: undefined });
navigation.setParams({ quoteBegin: Date.now() });

trackEvent(
createEventBuilder(MetaMetricsEvents.QUOTES_REQUESTED)
.addSensitiveProperties(data)
.addProperties(data)
.addSensitiveProperties(sensitiveData)
.build(),
);
}, [
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/Swaps/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ function SwapsAmountView({

trackEvent(
createEventBuilder(MetaMetricsEvents.SWAPS_OPENED)
.addSensitiveProperties(parameters)
.addProperties(parameters)
.build(),
);
});
Expand Down
Loading

0 comments on commit cdecdd3

Please sign in to comment.