From a025cd178d8741dc41c31d3823004d5c5628a15a Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 14 Jun 2017 15:23:13 -0700 Subject: [PATCH 1/3] Add issue template. --- ISSUE_TEMPLATE | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 ISSUE_TEMPLATE diff --git a/ISSUE_TEMPLATE b/ISSUE_TEMPLATE new file mode 100644 index 000000000..9c17ec3cd --- /dev/null +++ b/ISSUE_TEMPLATE @@ -0,0 +1,17 @@ + From 3062254c5660cc4f3fa887c58f0bba6a6b533ca7 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Thu, 15 Jun 2017 16:20:19 -0700 Subject: [PATCH 2/3] Do not recommend posting logs publicly on github. This exposes all user accounts, and not all users will want to do this, so we should not recommend this. --- ISSUE_TEMPLATE | 2 -- 1 file changed, 2 deletions(-) diff --git a/ISSUE_TEMPLATE b/ISSUE_TEMPLATE index 9c17ec3cd..d0ff3c08e 100644 --- a/ISSUE_TEMPLATE +++ b/ISSUE_TEMPLATE @@ -4,8 +4,6 @@ FAQ: Common questions such as "Where is my ether?" or "Where did my tokens go?" are answered in the FAQ. Bug Reports: - In order to quickly expedite your issue, please follow the directions here and paste the results into your issue. - https://github.com/MetaMask/faq/blob/master/LOGS.md Briefly describe the issue you've encountered * Expected Behavior From 06f6aa7a00f57004746d1e21759ac56396d9b855 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Thu, 15 Jun 2017 18:00:24 -0700 Subject: [PATCH 3/3] Debounce background updates Our background sometimes emits absurd quantities of updates very quickly. This PR reduces the amount of inter-process traffic by ensuring the `sendUpdate` method does not fire more than every 200 ms. Fixes #1621 --- app/scripts/metamask-controller.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index a7eb3d056..d745d29dc 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -23,6 +23,7 @@ const autoFaucet = require('./lib/auto-faucet') const nodeify = require('./lib/nodeify') const accountImporter = require('./account-import-strategies') const getBuyEthUrl = require('./lib/buy-eth-url') +const debounce = require('debounce') const version = require('../manifest.json').version @@ -30,6 +31,9 @@ module.exports = class MetamaskController extends EventEmitter { constructor (opts) { super() + + this.sendUpdate = debounce(this.privateSendUpdate.bind(this), 200) + this.opts = opts const initState = opts.initState || {} @@ -354,7 +358,7 @@ module.exports = class MetamaskController extends EventEmitter { ) } - sendUpdate () { + privateSendUpdate () { this.emit('update', this.getState()) }