From ae5ee105bf5cd96bfa878dcb2e31f1a531d3990d Mon Sep 17 00:00:00 2001 From: MetaMask Bot Date: Fri, 22 Jan 2021 18:29:03 +0000 Subject: [PATCH 1/4] Version v9.0.3 --- CHANGELOG.md | 2 ++ app/manifest/_base.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 359eaa009..20a379f9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Current Develop Branch +## 9.0.3 Fri Jan 22 2021 + ## 9.0.2 Wed Jan 20 2021 - [#10191](https://github.com/MetaMask/metamask-extension/pull/10191): zh_TW: 乙太 -> 以太 (#10191) diff --git a/app/manifest/_base.json b/app/manifest/_base.json index 89b75c0af..f299aebb2 100644 --- a/app/manifest/_base.json +++ b/app/manifest/_base.json @@ -78,6 +78,6 @@ "notifications" ], "short_name": "__MSG_appName__", - "version": "9.0.2", + "version": "9.0.3", "web_accessible_resources": ["inpage.js", "phishing.html"] } From a88a087b60d432b389b645b586e643845430b113 Mon Sep 17 00:00:00 2001 From: Thomas Huang Date: Fri, 22 Jan 2021 10:27:07 -0800 Subject: [PATCH 2/4] Fix site metadata JSON-RPC handler (#10243) * Fix getting the site metadata from the request origin params. Regressed from inpage-provider ts migration the request. The property domainMetadata is now set as a params key for the request. https://github.com/MetaMask/inpage-provider/blob/v7.0.0/src/siteMetadata.js#L19-L25 vs https://github.com/MetaMask/inpage-provider/blob/main/src/siteMetadata.ts#L19-L27 * Change hardcoded mocked response of the request to the prod response. --- .../controllers/permissions/permissionsMethodMiddleware.js | 4 ++-- test/unit/app/controllers/permissions/mocks.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/scripts/controllers/permissions/permissionsMethodMiddleware.js b/app/scripts/controllers/permissions/permissionsMethodMiddleware.js index de9009f13..2a2485e33 100644 --- a/app/scripts/controllers/permissions/permissionsMethodMiddleware.js +++ b/app/scripts/controllers/permissions/permissionsMethodMiddleware.js @@ -74,8 +74,8 @@ export default function createPermissionsMethodMiddleware({ // custom method for getting metadata from the requesting domain, // sent automatically by the inpage provider when it's initialized case 'metamask_sendDomainMetadata': { - if (typeof req.domainMetadata?.name === 'string') { - addDomainMetadata(req.origin, req.domainMetadata) + if (typeof req.params?.name === 'string') { + addDomainMetadata(req.origin, req.params) } res.result = true return diff --git a/test/unit/app/controllers/permissions/mocks.js b/test/unit/app/controllers/permissions/mocks.js index 48937faf2..6c977f272 100644 --- a/test/unit/app/controllers/permissions/mocks.js +++ b/test/unit/app/controllers/permissions/mocks.js @@ -600,7 +600,7 @@ export const getters = deepFreeze({ return { origin, method: 'metamask_sendDomainMetadata', - domainMetadata: { + params: { ...args, name, }, From 6d5683dd3f4b1059e8b9f8b8f0a2796b7659ce8d Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Fri, 22 Jan 2021 15:10:43 -0330 Subject: [PATCH 3/4] Fix decrypt message confirmation UI crash (#10252) The decrupt message confirmation UI will crash if the origin metadata is not present. This PR makes the UI tolerant of that metadata being missing. It was always intended to be optional anyway. --- .../confirm-decrypt-message.component.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ui/app/pages/confirm-decrypt-message/confirm-decrypt-message.component.js b/ui/app/pages/confirm-decrypt-message/confirm-decrypt-message.component.js index a9f68d388..d9baf455e 100644 --- a/ui/app/pages/confirm-decrypt-message/confirm-decrypt-message.component.js +++ b/ui/app/pages/confirm-decrypt-message/confirm-decrypt-message.component.js @@ -174,8 +174,9 @@ export default class ConfirmDecryptMessage extends Component { const { decryptMessageInline, domainMetadata, txData } = this.props const { t } = this.context - const origin = domainMetadata[txData.msgParams.origin] - const notice = t('decryptMessageNotice', [origin.name]) + const originMetadata = domainMetadata[txData.msgParams.origin] + const name = originMetadata?.name || txData.msgParams.origin + const notice = t('decryptMessageNotice', [txData.msgParams.origin]) const { hasCopied, @@ -191,15 +192,15 @@ export default class ConfirmDecryptMessage extends Component { {this.renderAccountInfo()}
- {origin.icon ? ( + {originMetadata?.icon ? ( ) : ( - {origin.name.charAt(0).toUpperCase()} + {name.charAt(0).toUpperCase()} )}
{notice}
From 727ed51a8e0826b5a7a407a3f8b97c7b7697055d Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Fri, 22 Jan 2021 15:27:33 -0330 Subject: [PATCH 4/4] Update v9.0.3 changelog (#10254) All commits have been included in the changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20a379f9f..2c3439235 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ ## Current Develop Branch ## 9.0.3 Fri Jan 22 2021 +- [#10243](https://github.com/MetaMask/metamask-extension/pull/10243): Fix site metadata handling +- [#10252](https://github.com/MetaMask/metamask-extension/pull/10252): Fix decrypt message confirmation UI crash ## 9.0.2 Wed Jan 20 2021