From ea7e46ed3843b2d38fe04efa232dc8f5cddb6186 Mon Sep 17 00:00:00 2001 From: kumavis Date: Tue, 5 Sep 2017 16:46:21 -0700 Subject: [PATCH] inpage - bug fix prevents mutation of original message object which causes problems with web3 1.0 --- app/scripts/lib/inpage-provider.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/scripts/lib/inpage-provider.js b/app/scripts/lib/inpage-provider.js index 7c74a62d3..c63af06dc 100644 --- a/app/scripts/lib/inpage-provider.js +++ b/app/scripts/lib/inpage-provider.js @@ -43,8 +43,9 @@ function MetamaskInpageProvider (connectionStream) { // handle sendAsync requests via asyncProvider self.sendAsync = function (payload, cb) { // rewrite request ids - var request = eachJsonMessage(payload, (message) => { - var newId = createRandomId() + var request = eachJsonMessage(payload, (_message) => { + const message = Object.assign({}, _message) + const newId = createRandomId() self.idMap[newId] = message.id message.id = newId return message