1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-27 12:56:01 +01:00
metamask-extension/ui/app/pages
Mark Stacey fe28e0d134
Cleanup beforeunload handler after transaction is resolved (#7333)
* Cleanup beforeunload handler after transaction is resolved

The notification window was updated to reject transactions upon close
in #6340. A handler that rejects the transaction was added to
`window.onbeforeunload`, and it was cleared in `actions.js` if it was
confirmed or rejected.

However, the `onbeforeunload` handler remained uncleared if the
transaction was resolved in another window. This results in the
transaction being rejected when the notification window closes, even
long after the transaction is submitted and confirmed. This has been
the cause of many problems with the Firefox e2e tests.

Instead the `onbeforeunload` handler is cleared in the
`componentWillUnmount` lifecycle function, alongside where it's set in
the first place. This ensures that it's correctly unset regardless
of how the transaction was resolved, and it better matches user
expectations.

* Fix indentation and remove redundant export

The `run-all.sh` Bash script now uses consistent indentation, and is
consistent about only re-exporting the Ganache arguments when they
change.

* Ensure transactions are completed before checking balance

Various intermittent e2e test failures appear to be caused by React
re-rendering the transaction list during the test, as the transaction
goes from pending to confirmed. To avoid this race condition, the
transaction is now explicitly looked for in the confirmed transaction
list in each of the tests using this pattern.

* Enable all e2e tests on Firefox

The remaining tests that were disabled on Firefox now work correctly.
Only a few timing adjustments were needed.

* Update Firefox used in CI

Firefox v70 is now used on CI instead of v68. This necessitated
rewriting the function where the extension ID was obtained because the
Firefox extensions page was redesigned.
2019-10-31 13:27:22 -03:00
..
add-token Right-to-left CSS (using module for conversion) (#7072) 2019-09-03 14:47:54 -03:00
confirm-add-suggested-token Enable indent linting via ESLint (#6936) 2019-07-31 10:17:11 -10:00
confirm-add-token Enable indent linting via ESLint (#6936) 2019-07-31 10:17:11 -10:00
confirm-approve Folder restructure (#6304) 2019-03-21 20:33:30 -02:30
confirm-deploy-contract Only pass english function names to functionType metric 2019-04-08 13:31:11 -02:30
confirm-send-ether Only pass english function names to functionType metric 2019-04-08 13:31:11 -02:30
confirm-send-token Folder restructure (#6304) 2019-03-21 20:33:30 -02:30
confirm-token-transaction-base Fix confirm token transaction amount display (#7081) 2019-08-31 13:26:49 -03:00
confirm-transaction Turn off full screen vs popup a/b test (#7298) 2019-10-21 20:59:02 -03:00
confirm-transaction-base Cleanup beforeunload handler after transaction is resolved (#7333) 2019-10-31 13:27:22 -03:00
confirm-transaction-switch 4byte fallback (#6551) 2019-06-18 09:47:14 -02:30
create-account Refactor new-account.js (#7312) 2019-10-29 12:12:41 -04:00
first-time-flow Cleanup beforeunload handler after transaction is resolved (#7333) 2019-10-31 13:27:22 -03:00
home Add migration on 3box imports and remove feature flag (#7209) 2019-09-26 03:24:52 -04:00
keychains Add migration on 3box imports and remove feature flag (#7209) 2019-09-26 03:24:52 -04:00
lock Folder restructure (#6304) 2019-03-21 20:33:30 -02:30
mobile-sync Update mobile sync (#6967) 2019-08-06 15:33:41 -04:00
provider-approval Add hostname and extensionId to site metadata (#7218) 2019-10-29 13:14:41 -03:00
routes Refactor new-account.js (#7312) 2019-10-29 12:12:41 -04:00
send Use AdvancedGasInputs in AdvancedTabContent (#7186) 2019-10-23 09:23:15 -03:00
settings Add static defaultProps 2019-10-29 17:55:10 -07:00
unlock-page Open retore-vault route from popup (#6353) 2019-03-26 23:35:29 -07:00
index.js Folder restructure (#6304) 2019-03-21 20:33:30 -02:30
index.scss Address book send plus contact list (#6914) 2019-07-31 17:26:44 -02:30