1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +01:00

Merge pull request #17096 from MetaMask/Version-v10.23.3

Version v10.23.3 RC
This commit is contained in:
Dan J Miller 2023-01-10 11:08:30 -03:30 committed by GitHub
commit 6dddb2c640
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 266 additions and 96 deletions

View File

@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [10.23.3]
## [10.23.2]
### Fixed
- Improve performance on signature request screens ([#17052](https://github.com/MetaMask/metamask-extension/pull/17052))
@ -3344,7 +3346,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Uncategorized
- Added the ability to restore accounts from seed words.
[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.23.2...HEAD
[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.23.3...HEAD
[10.23.3]: https://github.com/MetaMask/metamask-extension/compare/v10.23.2...v10.23.3
[10.23.2]: https://github.com/MetaMask/metamask-extension/compare/v10.23.1...v10.23.2
[10.23.1]: https://github.com/MetaMask/metamask-extension/compare/v10.23.0...v10.23.1
[10.23.0]: https://github.com/MetaMask/metamask-extension/compare/v10.22.3...v10.23.0

View File

@ -35,15 +35,18 @@ const defaultCaptureException = (err) => {
// The function is used to build a unique messageId for segment messages
// It uses actionId and uniqueIdentifier from event if present
const buildUniqueMessageId = (args) => {
let messageId = '';
const messageIdParts = [];
if (args.uniqueIdentifier) {
messageId += `${args.uniqueIdentifier}-`;
messageIdParts.push(args.uniqueIdentifier);
}
if (args.actionId) {
messageId += args.actionId;
messageIdParts.push(args.actionId);
}
if (messageId.length) {
return messageId;
if (messageIdParts.length && args.isDuplicateAnonymizedEvent) {
messageIdParts.push('0x000');
}
if (messageIdParts.length) {
return messageIdParts.join('-');
}
return generateRandomId();
};
@ -536,6 +539,7 @@ export default class MetaMetricsController {
this._buildEventPayload({
...payload,
properties: combinedProperties,
isDuplicateAnonymizedEvent: true,
}),
{ ...options, excludeMetaMetricsId: true },
),

View File

@ -159,6 +159,7 @@ describe('MetaMetricsController', function () {
clock = sinon.useFakeTimers(now.getTime());
sinon.stub(Utils, 'generateRandomId').returns('DUMMY_RANDOM_ID');
});
describe('constructor', function () {
it('should properly initialize', function () {
const mock = sinon.mock(segment);
@ -681,6 +682,197 @@ describe('MetaMetricsController', function () {
});
});
describe('deterministic messageId', function () {
it('should use the actionId as messageId when provided', function () {
const metaMetricsController = getMetaMetricsController();
const spy = sinon.spy(segment, 'track');
metaMetricsController.submitEvent({
event: 'Fake Event',
category: 'Unit Test',
properties: { foo: 'bar' },
actionId: '0x001',
});
assert.ok(spy.calledOnce);
assert.ok(
spy.calledWith({
event: 'Fake Event',
userId: TEST_META_METRICS_ID,
context: DEFAULT_TEST_CONTEXT,
properties: {
foo: 'bar',
...DEFAULT_EVENT_PROPERTIES,
},
messageId: '0x001',
timestamp: new Date(),
}),
);
});
it('should append 0x000 to the actionId of anonymized event when tracking sensitiveProperties', function () {
const metaMetricsController = getMetaMetricsController();
const spy = sinon.spy(segment, 'track');
metaMetricsController.submitEvent({
event: 'Fake Event',
category: 'Unit Test',
sensitiveProperties: { foo: 'bar' },
actionId: '0x001',
});
assert.ok(spy.calledTwice);
assert.ok(
spy.calledWith({
event: 'Fake Event',
anonymousId: METAMETRICS_ANONYMOUS_ID,
context: DEFAULT_TEST_CONTEXT,
properties: {
foo: 'bar',
...DEFAULT_EVENT_PROPERTIES,
},
messageId: '0x001-0x000',
timestamp: new Date(),
}),
);
assert.ok(
spy.calledWith({
event: 'Fake Event',
userId: TEST_META_METRICS_ID,
context: DEFAULT_TEST_CONTEXT,
properties: {
...DEFAULT_EVENT_PROPERTIES,
},
messageId: '0x001',
timestamp: new Date(),
}),
);
});
it('should use the uniqueIdentifier as messageId when provided', function () {
const metaMetricsController = getMetaMetricsController();
const spy = sinon.spy(segment, 'track');
metaMetricsController.submitEvent({
event: 'Fake Event',
category: 'Unit Test',
properties: { foo: 'bar' },
uniqueIdentifier: 'transaction-submitted-0000',
});
assert.ok(spy.calledOnce);
assert.ok(
spy.calledWith({
event: 'Fake Event',
userId: TEST_META_METRICS_ID,
context: DEFAULT_TEST_CONTEXT,
properties: {
foo: 'bar',
...DEFAULT_EVENT_PROPERTIES,
},
messageId: 'transaction-submitted-0000',
timestamp: new Date(),
}),
);
});
it('should append 0x000 to the uniqueIdentifier of anonymized event when tracking sensitiveProperties', function () {
const metaMetricsController = getMetaMetricsController();
const spy = sinon.spy(segment, 'track');
metaMetricsController.submitEvent({
event: 'Fake Event',
category: 'Unit Test',
sensitiveProperties: { foo: 'bar' },
uniqueIdentifier: 'transaction-submitted-0000',
});
assert.ok(spy.calledTwice);
assert.ok(
spy.calledWith({
event: 'Fake Event',
anonymousId: METAMETRICS_ANONYMOUS_ID,
context: DEFAULT_TEST_CONTEXT,
properties: {
foo: 'bar',
...DEFAULT_EVENT_PROPERTIES,
},
messageId: 'transaction-submitted-0000-0x000',
timestamp: new Date(),
}),
);
assert.ok(
spy.calledWith({
event: 'Fake Event',
userId: TEST_META_METRICS_ID,
context: DEFAULT_TEST_CONTEXT,
properties: {
...DEFAULT_EVENT_PROPERTIES,
},
messageId: 'transaction-submitted-0000',
timestamp: new Date(),
}),
);
});
it('should combine the uniqueIdentifier and actionId as messageId when both provided', function () {
const metaMetricsController = getMetaMetricsController();
const spy = sinon.spy(segment, 'track');
metaMetricsController.submitEvent({
event: 'Fake Event',
category: 'Unit Test',
properties: { foo: 'bar' },
actionId: '0x001',
uniqueIdentifier: 'transaction-submitted-0000',
});
assert.ok(spy.calledOnce);
assert.ok(
spy.calledWith({
event: 'Fake Event',
userId: TEST_META_METRICS_ID,
context: DEFAULT_TEST_CONTEXT,
properties: {
foo: 'bar',
...DEFAULT_EVENT_PROPERTIES,
},
messageId: 'transaction-submitted-0000-0x001',
timestamp: new Date(),
}),
);
});
it('should append 0x000 to the combined uniqueIdentifier and actionId of anonymized event when tracking sensitiveProperties', function () {
const metaMetricsController = getMetaMetricsController();
const spy = sinon.spy(segment, 'track');
metaMetricsController.submitEvent({
event: 'Fake Event',
category: 'Unit Test',
sensitiveProperties: { foo: 'bar' },
actionId: '0x001',
uniqueIdentifier: 'transaction-submitted-0000',
});
assert.ok(spy.calledTwice);
assert.ok(
spy.calledWith({
event: 'Fake Event',
anonymousId: METAMETRICS_ANONYMOUS_ID,
context: DEFAULT_TEST_CONTEXT,
properties: {
foo: 'bar',
...DEFAULT_EVENT_PROPERTIES,
},
messageId: 'transaction-submitted-0000-0x001-0x000',
timestamp: new Date(),
}),
);
assert.ok(
spy.calledWith({
event: 'Fake Event',
userId: TEST_META_METRICS_ID,
context: DEFAULT_TEST_CONTEXT,
properties: {
...DEFAULT_EVENT_PROPERTIES,
},
messageId: 'transaction-submitted-0000-0x001',
timestamp: new Date(),
}),
);
});
});
describe('_buildUserTraitsObject', function () {
it('should return full user traits object on first call', function () {
const MOCK_ALL_TOKENS = {

View File

@ -1291,7 +1291,7 @@
"@metamask/controllers>@ethersproject/providers": true,
"@metamask/controllers>isomorphic-fetch": true,
"@metamask/smart-transactions-controller>bignumber.js": true,
"@metamask/smart-transactions-controller>fast-json-patch": true,
"fast-json-patch": true,
"lodash": true
}
},
@ -1306,14 +1306,6 @@
"define": true
}
},
"@metamask/smart-transactions-controller>fast-json-patch": {
"globals": {
"addEventListener": true,
"clearTimeout": true,
"removeEventListener": true,
"setTimeout": true
}
},
"@metamask/snap-controllers>nanoid": {
"globals": {
"crypto.getRandomValues": true
@ -4471,9 +4463,6 @@
"clearTimeout": true,
"removeEventListener": true,
"setTimeout": true
},
"packages": {
"fast-json-patch>fast-deep-equal": true
}
},
"fuse.js": {

View File

@ -1536,7 +1536,7 @@
"@metamask/controllers>@ethersproject/providers": true,
"@metamask/controllers>isomorphic-fetch": true,
"@metamask/smart-transactions-controller>bignumber.js": true,
"@metamask/smart-transactions-controller>fast-json-patch": true,
"fast-json-patch": true,
"lodash": true
}
},
@ -1551,14 +1551,6 @@
"define": true
}
},
"@metamask/smart-transactions-controller>fast-json-patch": {
"globals": {
"addEventListener": true,
"clearTimeout": true,
"removeEventListener": true,
"setTimeout": true
}
},
"@metamask/snap-controllers": {
"globals": {
"URL": true,
@ -4992,9 +4984,6 @@
"clearTimeout": true,
"removeEventListener": true,
"setTimeout": true
},
"packages": {
"fast-json-patch>fast-deep-equal": true
}
},
"fuse.js": {

View File

@ -1291,7 +1291,7 @@
"@metamask/controllers>@ethersproject/providers": true,
"@metamask/controllers>isomorphic-fetch": true,
"@metamask/smart-transactions-controller>bignumber.js": true,
"@metamask/smart-transactions-controller>fast-json-patch": true,
"fast-json-patch": true,
"lodash": true
}
},
@ -1306,14 +1306,6 @@
"define": true
}
},
"@metamask/smart-transactions-controller>fast-json-patch": {
"globals": {
"addEventListener": true,
"clearTimeout": true,
"removeEventListener": true,
"setTimeout": true
}
},
"@metamask/snap-controllers>nanoid": {
"globals": {
"crypto.getRandomValues": true
@ -4471,9 +4463,6 @@
"clearTimeout": true,
"removeEventListener": true,
"setTimeout": true
},
"packages": {
"fast-json-patch>fast-deep-equal": true
}
},
"fuse.js": {

View File

@ -1,6 +1,6 @@
{
"name": "metamask-crx",
"version": "10.23.2",
"version": "10.23.3",
"private": true,
"repository": {
"type": "git",
@ -174,7 +174,7 @@
"ethjs-contract": "^0.2.3",
"ethjs-query": "^0.3.4",
"extension-port-stream": "^2.0.0",
"fast-json-patch": "^2.2.1",
"fast-json-patch": "^3.1.1",
"fuse.js": "^3.2.0",
"globalthis": "^1.0.1",
"human-standard-token-abi": "^2.0.0",
@ -188,7 +188,7 @@
"localforage": "^1.9.0",
"lodash": "^4.17.21",
"loglevel": "^1.4.1",
"luxon": "^3.1.0",
"luxon": "^3.2.1",
"nanoid": "^2.1.6",
"nonce-tracker": "^1.0.0",
"obj-multiplex": "^1.0.0",

View File

@ -1,13 +0,0 @@
diff --git a/node_modules/@metamask/smart-transactions-controller/node_modules/fast-json-patch/commonjs/helpers.js b/node_modules/@metamask/smart-transactions-controller/node_modules/fast-json-patch/commonjs/helpers.js
index 0ac28b4..d048c0a 100644
--- a/node_modules/@metamask/smart-transactions-controller/node_modules/fast-json-patch/commonjs/helpers.js
+++ b/node_modules/@metamask/smart-transactions-controller/node_modules/fast-json-patch/commonjs/helpers.js
@@ -21,7 +21,7 @@ var _hasOwnProperty = Object.prototype.hasOwnProperty;
function hasOwnProperty(obj, key) {
return _hasOwnProperty.call(obj, key);
}
-exports.hasOwnProperty = hasOwnProperty;
+Object.defineProperty(exports, "hasOwnProperty", { value: hasOwnProperty });
function _objectKeys(obj) {
if (Array.isArray(obj)) {
var keys = new Array(obj.length);

View File

@ -1,7 +1,7 @@
diff --git a/node_modules/fast-json-patch/lib/helpers.js b/node_modules/fast-json-patch/lib/helpers.js
index 0ac28b4..d048c0a 100644
--- a/node_modules/fast-json-patch/lib/helpers.js
+++ b/node_modules/fast-json-patch/lib/helpers.js
diff --git a/node_modules/fast-json-patch/commonjs/helpers.js b/node_modules/fast-json-patch/commonjs/helpers.js
index 5f2350e..8894686 100644
--- a/node_modules/fast-json-patch/commonjs/helpers.js
+++ b/node_modules/fast-json-patch/commonjs/helpers.js
@@ -21,7 +21,7 @@ var _hasOwnProperty = Object.prototype.hasOwnProperty;
function hasOwnProperty(obj, key) {
return _hasOwnProperty.call(obj, key);
@ -10,4 +10,4 @@ index 0ac28b4..d048c0a 100644
+Object.defineProperty(exports, "hasOwnProperty", { value: hasOwnProperty });
function _objectKeys(obj) {
if (Array.isArray(obj)) {
var keys = new Array(obj.length);
var keys_1 = new Array(obj.length);

View File

@ -1,22 +0,0 @@
diff --git a/node_modules/luxon/build/cjs-browser/luxon.js b/node_modules/luxon/build/cjs-browser/luxon.js
index 9ab2b9f..14c2891 100644
--- a/node_modules/luxon/build/cjs-browser/luxon.js
+++ b/node_modules/luxon/build/cjs-browser/luxon.js
@@ -7373,7 +7373,7 @@ var DateTime = /*#__PURE__*/function () {
*/
;
- _proto.toLocaleString = function toLocaleString(formatOpts, opts) {
+ Reflect.defineProperty(_proto, 'toLocaleString', { value: function toLocaleString(formatOpts, opts) {
if (formatOpts === void 0) {
formatOpts = DATE_SHORT;
}
@@ -7383,7 +7383,7 @@ var DateTime = /*#__PURE__*/function () {
}
return this.isValid ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this) : INVALID;
- }
+ }})
/**
* Returns an array of format "parts", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.
* Defaults to the system's locale if no locale has been specified

40
patches/luxon+3.2.1.patch Normal file
View File

@ -0,0 +1,40 @@
diff --git a/node_modules/luxon/build/cjs-browser/luxon.js b/node_modules/luxon/build/cjs-browser/luxon.js
index 776c38a..c0f0c21 100644
--- a/node_modules/luxon/build/cjs-browser/luxon.js
+++ b/node_modules/luxon/build/cjs-browser/luxon.js
@@ -4226,7 +4226,7 @@ var Interval = /*#__PURE__*/function () {
* @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 8:00 p
* @return {string}
*/;
- _proto.toLocaleString = function toLocaleString(formatOpts, opts) {
+ Reflect.defineProperty(_proto, 'toLocaleString', { value: function toLocaleString(formatOpts, opts) {
if (formatOpts === void 0) {
formatOpts = DATE_SHORT;
}
@@ -4234,7 +4234,7 @@ var Interval = /*#__PURE__*/function () {
opts = {};
}
return this.isValid ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this) : INVALID$1;
- }
+ }})
/**
* Returns an ISO 8601-compliant string representation of this Interval.
@@ -6598,7 +6598,7 @@ var DateTime = /*#__PURE__*/function () {
* @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'
* @return {string}
*/;
- _proto.toLocaleString = function toLocaleString(formatOpts, opts) {
+ Reflect.defineProperty(_proto, 'toLocaleString', { value: function toLocaleString(formatOpts, opts) {
if (formatOpts === void 0) {
formatOpts = DATE_SHORT;
}
@@ -6606,7 +6606,7 @@ var DateTime = /*#__PURE__*/function () {
opts = {};
}
return this.isValid ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this) : INVALID;
- }
+ }})
/**
* Returns an array of format "parts", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.

View File

@ -24,7 +24,6 @@ import {
getSelectedAddress,
getIsBuyableTransakChain,
getIsBuyableMoonPayChain,
getIsBuyableWyreChain,
getIsBuyableCoinbasePayChain,
getIsBuyableCoinbasePayToken,
getIsBuyableTransakToken,
@ -46,7 +45,7 @@ const DepositPopover = ({ onClose, token }) => {
const address = useSelector(getSelectedAddress);
const isBuyableTransakChain = useSelector(getIsBuyableTransakChain);
const isBuyableMoonPayChain = useSelector(getIsBuyableMoonPayChain);
const isBuyableWyreChain = useSelector(getIsBuyableWyreChain);
const isBuyableWyreChain = false;
const isBuyableCoinbasePayChain = useSelector(getIsBuyableCoinbasePayChain);
const isTokenBuyableCoinbasePay = useSelector((state) =>

View File

@ -12112,17 +12112,17 @@ fast-json-parse@^1.0.3:
resolved "https://registry.yarnpkg.com/fast-json-parse/-/fast-json-parse-1.0.3.tgz#43e5c61ee4efa9265633046b770fb682a7577c4d"
integrity sha512-FRWsaZRWEJ1ESVNbDWmsAlqDk96gPQezzLghafp5J4GUKjbCz3OkAHuZs5TuPEtkbVQERysLp9xv6c24fBm8Aw==
fast-json-patch@^2.0.6, fast-json-patch@^2.2.1:
fast-json-patch@^2.0.6:
version "2.2.1"
resolved "https://registry.yarnpkg.com/fast-json-patch/-/fast-json-patch-2.2.1.tgz#18150d36c9ab65c7209e7d4eb113f4f8eaabe6d9"
integrity sha512-4j5uBaTnsYAV5ebkidvxiLUYOwjQ+JSFljeqfTxCrH9bDmlCQaOJFS84oDJ2rAXZq2yskmk3ORfoP9DCwqFNig==
dependencies:
fast-deep-equal "^2.0.1"
fast-json-patch@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/fast-json-patch/-/fast-json-patch-3.1.0.tgz#ec8cd9b9c4c564250ec8b9140ef7a55f70acaee6"
integrity sha512-IhpytlsVTRndz0hU5t0/MGzS/etxLlfrpG5V5M9mVbuj9TrJLWaMfsox9REM5rkuGX0T+5qjpe8XA1o0gZ42nA==
fast-json-patch@^3.1.0, fast-json-patch@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/fast-json-patch/-/fast-json-patch-3.1.1.tgz#85064ea1b1ebf97a3f7ad01e23f9337e72c66947"
integrity sha512-vf6IHUX2SBcA+5/+4883dsIjpBTqmfBjmYiWK1savxQmFk4JfBMLa7ynTYOs1Rolp/T1betJxHiGD3g1Mn8lUQ==
fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0:
version "2.1.0"
@ -16914,10 +16914,10 @@ ltgt@~2.2.0:
resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.2.1.tgz#f35ca91c493f7b73da0e07495304f17b31f87ee5"
integrity sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=
luxon@^3.0.1, luxon@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.1.0.tgz#9ac33d7142b7ea18d4ec8583cdeb0b079abef60d"
integrity sha512-7w6hmKC0/aoWnEsmPCu5Br54BmbmUp5GfcqBxQngRcXJ+q5fdfjEzn7dxmJh2YdDhgW8PccYtlWKSv4tQkrTQg==
luxon@^3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.2.1.tgz#14f1af209188ad61212578ea7e3d518d18cee45f"
integrity sha512-QrwPArQCNLAKGO/C+ZIilgIuDnEnKx5QYODdDtbFaxzsbZcc/a7WFq7MhsVYgRlwawLtvOUESTlfJ+hc/USqPg==
madge@^5.0.1:
version "5.0.1"