{"action":"created","comment":{"url":"https://api.github.com/repos/MetaMask/metamask-extension/pulls/comments/134934675","pull_request_review_id":58284959,"id":134934675,"diff_hunk":"@@ -0,0 +1,83 @@\n+\n+const version = 19\n+\n+/*\n+\n+This migration sets transactions as failed\n+whos nonce is too high\n+\n+*/\n+\n+const clone = require('clone')\n+\n+module.exports = {\n+  version,\n+\n+  migrate: function (originalVersionedData) {\n+    const versionedData = clone(originalVersionedData)\n+    versionedData.meta.version = version\n+    try {\n+      const state = versionedData.data\n+      const newState = transformState(state)\n+      versionedData.data = newState\n+    } catch (err) {\n+      console.warn(`MetaMask Migration #${version}` + err.stack)\n+    }\n+    return Promise.resolve(versionedData)\n+  },\n+}\n+\n+function transformState (state) {\n+  const newState = state\n+  const transactions = newState.TransactionController.transactions\n+\n+  newState.TransactionController.transactions = transactions.map((txMeta, _, txList) => {\n+    if (txMeta.status !== 'submitted') return txMeta\n+\n+    const confirmedTxs = txList.filter((tx) => tx.status === 'confirmed')\n+    .filter((tx) => tx.txParams.from === txMeta.txParams.from)\n+    .filter((tx) => tx.metamaskNetworkId.from === txMeta.metamaskNetworkId.from)\n+    const highestConfirmedNonce = getHighestNonce(confirmedTxs)\n+\n+    const pendingTxs = txList.filter((tx) => tx.status === 'submitted')","path":"app/scripts/migrations/019.js","position":42,"original_position":42,"commit_id":"17a71a9b4cb5cc23cbedfc52ba35c562dffdc02e","original_commit_id":"17a71a9b4cb5cc23cbedfc52ba35c562dffdc02e","user":{"login":"frankiebee","id":11225267,"avatar_url":"https://avatars0.githubusercontent.com/u/11225267?v=4","gravatar_id":"","url":"https://api.github.com/users/frankiebee","html_url":"https://github.com/frankiebee","followers_url":"https://api.github.com/users/frankiebee/followers","following_url":"https://api.github.com/users/frankiebee/following{/other_user}","gists_url":"https://api.github.com/users/frankiebee/gists{/gist_id}","starred_url":"https://api.github.com/users/frankiebee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frankiebee/subscriptions","organizations_url":"https://api.github.com/users/frankiebee/orgs","repos_url":"https://api.github.com/users/frankiebee/repos","events_url":"https://api.github.com/users/frankiebee/events{/privacy}","received_events_url":"https://api.github.com/users/frankiebee/received_events","type":"User","site_admin":false},"body":"their is no state 'pending'","created_at":"2017-08-24T06:19:47Z","updated_at":"2017-08-24T06:19:47Z","html_url":"https://github.com/MetaMask/metamask-extension/pull/1973#discussion_r134934675","pull_request_url":"https://api.github.com/repos/MetaMask/metamask-extension/pulls/1973","_links":{"self":{"href":"https://api.github.com/repos/MetaMask/metamask-extension/pulls/comments/134934675"},"html":{"href":"https://github.com/MetaMask/metamask-extension/pull/1973#discussion_r134934675"},"pull_request":{"href":"https://api.github.com/repos/MetaMask/metamask-extension/pulls/1973"}}},"pull_request":{"url":"https://api.github.com/repos/MetaMask/metamask-extension/pulls/1973","id":137374320,"html_url":"https://github.com/MetaMask/metamask-extension/pull/1973","diff_url":"https://github.com/MetaMask/metamask-extension/pull/1973.diff","patch_url":"https://github.com/MetaMask/metamask-extension/pull/1973.patch","issue_url":"https://api.github.com/repos/MetaMask/metamask-extension/issues/1973","number":1973,"state":"open","locked":false,"title":"hotfix - fail submitted txs whos nonce is out of bound","user":{"login":"frankiebee","id":11225267,"avatar_url":"https://avatars0.githubusercontent.com/u/11225267?v=4","gravatar_id":"","url":"https://api.github.com/users/frankiebee","html_url":"https://github.com/frankiebee","followers_url":"https://api.github.com/users/frankiebee/followers","following_url":"https://api.github.com/users/frankiebee/following{/other_user}","gists_url":"https://api.github.com/users/frankiebee/gists{/gist_id}","starred_url":"https://api.github.com/users/frankiebee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frankiebee/subscriptions","organizations_url":"https://api.github.com/users/frankiebee/orgs","repos_url":"https://api.github.com/users/frankiebee/repos","events_url":"https://api.github.com/users/frankiebee/events{/privacy}","received_events_url":"https://api.github.com/users/frankiebee/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-08-24T05:53:42Z","updated_at":"2017-08-24T06:19:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"251c797a32312a2a6baa0e36c0fe87a6ded0cf37","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/MetaMask/metamask-extension/pulls/1973/commits","review_comments_url":"https://api.github.com/repos/MetaMask/metamask-extension/pulls/1973/comments","review_comment_url":"https://api.github.com/repos/MetaMask/metamask-extension/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MetaMask/metamask-extension/issues/1973/comments","statuses_url":"https://api.github.com/repos/MetaMask/metamask-extension/statuses/17a71a9b4cb5cc23cbedfc52ba35c562dffdc02e","head":{"label":"MetaMask:hotfix-migration019","ref":"hotfix-migration019","sha":"17a71a9b4cb5cc23cbedfc52ba35c562dffdc02e","user":{"login":"MetaMask","id":11744586,"avatar_url":"https://avatars2.githubusercontent.com/u/11744586?v=4","gravatar_id":"","url":"https://api.github.com/users/MetaMask","html_url":"https://github.com/MetaMask","followers_url":"https://api.github.com/users/MetaMask/followers","following_url":"https://api.github.com/users/MetaMask/following{/other_user}","gists_url":"https://api.github.com/users/MetaMask/gists{/gist_id}","starred_url":"https://api.github.com/users/MetaMask/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MetaMask/subscriptions","organizations_url":"https://api.github.com/users/MetaMask/orgs","repos_url":"https://api.github.com/users/MetaMask/repos","events_url":"https://api.github.com/users/MetaMask/events{/privacy}","received_events_url":"https://api.github.com/users/MetaMask/received_events","type":"Organization","site_admin":false},"repo":{"id":42009758,"name":"metamask-extension","full_name":"MetaMask/metamask-extension","owner":{"login":"MetaMask","id":11744586,"avatar_url":"https://avatars2.githubusercontent.com/u/11744586?v=4","gravatar_id":"","url":"https://api.github.com/users/MetaMask","html_url":"https://github.com/MetaMask","followers_url":"https://api.github.com/users/MetaMask/followers","following_url":"https://api.github.com/users/MetaMask/following{/other_user}","gists_url":"https://api.github.com/users/MetaMask/gists{/gist_id}","starred_url":"https://api.github.com/users/MetaMask/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MetaMask/subscriptions","organizations_url":"https://api.github.com/users/MetaMask/orgs","repos_url":"https://api.github.com/users/MetaMask/repos","events_url":"https://api.github.com/users/MetaMask/events{/privacy}","received_events_url":"https://api.github.com/users/MetaMask/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MetaMask/metamask-extension","description":":globe_with_meridians: :electric_plug: metamask chrome extension","fork":false,"url":"https://api.github.com/repos/MetaMask/metamask-extension","forks_url":"https://api.github.com/repos/MetaMask/metamask-extension/forks","keys_url":"https://api.github.com/repos/MetaMask/metamask-extension/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MetaMask/metamask-extension/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MetaMask/metamask-extension/teams","hooks_url":"https://api.github.com/repos/MetaMask/metamask-extension/hooks","issue_events_url":"https://api.github.com/repos/MetaMask/metamask-extension/issues/events{/number}","events_url":"https://api.github.com/repos/MetaMask/metamask-extension/events","assignees_url":"https://api.github.com/repos/MetaMask/metamask-extension/assignees{/user}","branches_url":"https://api.github.com/repos/MetaMask/metamask-extension/branches{/branch}","tags_url":"https://api.github.com/repos/MetaMask/metamask-extension/tags","blobs_url":"https://api.github.com/repos/MetaMask/metamask-extension/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MetaMask/metamask-extension/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MetaMask/metamask-extension/git/refs{/sha}","trees_url":"https://api.github.com/repos/MetaMask/metamask-extension/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MetaMask/metamask-extension/statuses/{sha}","languages_url":"https://api.github.com/repos/MetaMask/metamask-extension/languages","stargazers_url":"https://api.github.com/repos/MetaMask/metamask-extension/stargazers","contributors_url":"https://api.github.com/repos/MetaMask/metamask-extension/contributors","subscribers_url":"https://api.github.com/repos/MetaMask/metamask-extension/subscribers","subscription_url":"https://api.github.com/repos/MetaMask/metamask-extension/subscription","commits_url":"https://api.github.com/repos/MetaMask/metamask-extension/commits{/sha}","git_commits_url":"https://api.github.com/repos/MetaMask/metamask-extension/git/commits{/sha}","comments_url":"https://api.github.com/repos/MetaMask/metamask-extension/comments{/number}","issue_comment_url":"https://api.github.com/repos/MetaMask/metamask-extension/issues/comments{/number}","contents_url":"https://api.github.com/repos/MetaMask/metamask-extension/contents/{+path}","compare_url":"https://api.github.com/repos/MetaMask/metamask-extension/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MetaMask/metamask-extension/merges","archive_url":"https://api.github.com/repos/MetaMask/metamask-extension/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MetaMask/metamask-extension/downloads","issues_url":"https://api.github.com/repos/MetaMask/metamask-extension/issues{/number}","pulls_url":"https://api.github.com/repos/MetaMask/metamask-extension/pulls{/number}","milestones_url":"https://api.github.com/repos/MetaMask/metamask-extension/milestones{/number}","notifications_url":"https://api.github.com/repos/MetaMask/metamask-extension/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MetaMask/metamask-extension/labels{/name}","releases_url":"https://api.github.com/repos/MetaMask/metamask-extension/releases{/id}","deployments_url":"https://api.github.com/repos/MetaMask/metamask-extension/deployments","created_at":"2015-09-06T16:34:48Z","updated_at":"2017-08-23T19:30:40Z","pushed_at":"2017-08-24T06:13:53Z","git_url":"git://github.com/MetaMask/metamask-extension.git","ssh_url":"git@github.com:MetaMask/metamask-extension.git","clone_url":"https://github.com/MetaMask/metamask-extension.git","svn_url":"https://github.com/MetaMask/metamask-extension","homepage":"https://metamask.io/","size":16503,"stargazers_count":418,"watchers_count":418,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":98,"mirror_url":null,"open_issues_count":311,"forks":98,"open_issues":311,"watchers":418,"default_branch":"master"}},"base":{"label":"MetaMask:master","ref":"master","sha":"799c4cb6903bd7395c82abe879978cc911ae0a36","user":{"login":"MetaMask","id":11744586,"avatar_url":"https://avatars2.githubusercontent.com/u/11744586?v=4","gravatar_id":"","url":"https://api.github.com/users/MetaMask","html_url":"https://github.com/MetaMask","followers_url":"https://api.github.com/users/MetaMask/followers","following_url":"https://api.github.com/users/MetaMask/following{/other_user}","gists_url":"https://api.github.com/users/MetaMask/gists{/gist_id}","starred_url":"https://api.github.com/users/MetaMask/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MetaMask/subscriptions","organizations_url":"https://api.github.com/users/MetaMask/orgs","repos_url":"https://api.github.com/users/MetaMask/repos","events_url":"https://api.github.com/users/MetaMask/events{/privacy}","received_events_url":"https://api.github.com/users/MetaMask/received_events","type":"Organization","site_admin":false},"repo":{"id":42009758,"name":"metamask-extension","full_name":"MetaMask/metamask-extension","owner":{"login":"MetaMask","id":11744586,"avatar_url":"https://avatars2.githubusercontent.com/u/11744586?v=4","gravatar_id":"","url":"https://api.github.com/users/MetaMask","html_url":"https://github.com/MetaMask","followers_url":"https://api.github.com/users/MetaMask/followers","following_url":"https://api.github.com/users/MetaMask/following{/other_user}","gists_url":"https://api.github.com/users/MetaMask/gists{/gist_id}","starred_url":"https://api.github.com/users/MetaMask/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MetaMask/subscriptions","organizations_url":"https://api.github.com/users/MetaMask/orgs","repos_url":"https://api.github.com/users/MetaMask/repos","events_url":"https://api.github.com/users/MetaMask/events{/privacy}","received_events_url":"https://api.github.com/users/MetaMask/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MetaMask/metamask-extension","description":":globe_with_meridians: :electric_plug: metamask chrome extension","fork":false,"url":"https://api.github.com/repos/MetaMask/metamask-extension","forks_url":"https://api.github.com/repos/MetaMask/metamask-extension/forks","keys_url":"https://api.github.com/repos/MetaMask/metamask-extension/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MetaMask/metamask-extension/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MetaMask/metamask-extension/teams","hooks_url":"https://api.github.com/repos/MetaMask/metamask-extension/hooks","issue_events_url":"https://api.github.com/repos/MetaMask/metamask-extension/issues/events{/number}","events_url":"https://api.github.com/repos/MetaMask/metamask-extension/events","assignees_url":"https://api.github.com/repos/MetaMask/metamask-extension/assignees{/user}","branches_url":"https://api.github.com/repos/MetaMask/metamask-extension/branches{/branch}","tags_url":"https://api.github.com/repos/MetaMask/metamask-extension/tags","blobs_url":"https://api.github.com/repos/MetaMask/metamask-extension/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MetaMask/metamask-extension/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MetaMask/metamask-extension/git/refs{/sha}","trees_url":"https://api.github.com/repos/MetaMask/metamask-extension/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MetaMask/metamask-extension/statuses/{sha}","languages_url":"https://api.github.com/repos/MetaMask/metamask-extension/languages","stargazers_url":"https://api.github.com/repos/MetaMask/metamask-extension/stargazers","contributors_url":"https://api.github.com/repos/MetaMask/metamask-extension/contributors","subscribers_url":"https://api.github.com/repos/MetaMask/metamask-extension/subscribers","subscription_url":"https://api.github.com/repos/MetaMask/metamask-extension/subscription","commits_url":"https://api.github.com/repos/MetaMask/metamask-extension/commits{/sha}","git_commits_url":"https://api.github.com/repos/MetaMask/metamask-extension/git/commits{/sha}","comments_url":"https://api.github.com/repos/MetaMask/metamask-extension/comments{/number}","issue_comment_url":"https://api.github.com/repos/MetaMask/metamask-extension/issues/comments{/number}","contents_url":"https://api.github.com/repos/MetaMask/metamask-extension/contents/{+path}","compare_url":"https://api.github.com/repos/MetaMask/metamask-extension/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MetaMask/metamask-extension/merges","archive_url":"https://api.github.com/repos/MetaMask/metamask-extension/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MetaMask/metamask-extension/downloads","issues_url":"https://api.github.com/repos/MetaMask/metamask-extension/issues{/number}","pulls_url":"https://api.github.com/repos/MetaMask/metamask-extension/pulls{/number}","milestones_url":"https://api.github.com/repos/MetaMask/metamask-extension/milestones{/number}","notifications_url":"https://api.github.com/repos/MetaMask/metamask-extension/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MetaMask/metamask-extension/labels{/name}","releases_url":"https://api.github.com/repos/MetaMask/metamask-extension/releases{/id}","deployments_url":"https://api.github.com/repos/MetaMask/metamask-extension/deployments","created_at":"2015-09-06T16:34:48Z","updated_at":"2017-08-23T19:30:40Z","pushed_at":"2017-08-24T06:13:53Z","git_url":"git://github.com/MetaMask/metamask-extension.git","ssh_url":"git@github.com:MetaMask/metamask-extension.git","clone_url":"https://github.com/MetaMask/metamask-extension.git","svn_url":"https://github.com/MetaMask/metamask-extension","homepage":"https://metamask.io/","size":16503,"stargazers_count":418,"watchers_count":418,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":98,"mirror_url":null,"open_issues_count":311,"forks":98,"open_issues":311,"watchers":418,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/MetaMask/metamask-extension/pulls/1973"},"html":{"href":"https://github.com/MetaMask/metamask-extension/pull/1973"},"issue":{"href":"https://api.github.com/repos/MetaMask/metamask-extension/issues/1973"},"comments":{"href":"https://api.github.com/repos/MetaMask/metamask-extension/issues/1973/comments"},"review_comments":{"href":"https://api.github.com/repos/MetaMask/metamask-extension/pulls/1973/comments"},"review_comment":{"href":"https://api.github.com/repos/MetaMask/metamask-extension/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MetaMask/metamask-extension/pulls/1973/commits"},"statuses":{"href":"https://api.github.com/repos/MetaMask/metamask-extension/statuses/17a71a9b4cb5cc23cbedfc52ba35c562dffdc02e"}}}}
{"actor":{"display_login":"frankiebee"}}