1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-12 12:47:14 +01:00
metamask-extension/app/scripts/lib
Olusegun Akintayo 4fa4930c8a
Add friendly error handling when background throws an error before listening for connection (#14461)
* When background port closes, UI should display a user friendly error.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Remove console.log

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

A couple of fixes
    1. Use timeout in metaRPCClientFactory to check if UI can't
       communicate with bg
    2. Refactor locale setup
    3. Fixed wording/capitalization
    4. Fix locales usage so that linting works
    5. Refactor CSS

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

do not simulate errorwq

Refactor loading css

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Remove the onDisconnect event handler in ui as this is handled in
metarpcclientfactory

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Do not throw in bg

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Fix PR comments

Remove unused message 'failedToLoadMessage'

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Move usage of locales to shared/** so that linter can see it.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Do not simulate error.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

metarpc can handle multiple requests, responseHandled should be a map.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

reload metamask button on critical error

Use metamask state (if available) to the locale, else read locale files
manually.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

use constant and numeric separator

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

refactor error utils

remove error simulation

Memoize setupLocale function

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

test cases

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Do not simulate error

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

1. store should be metamask state
2. code refactorings.
Tests: mock setupLocale

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Mock fetchLocale instead
Test setup locale

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

UI/CSS changes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Do not simulate failure

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* spell MetaMask correctly

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Rename state to mockStore

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* we should clean up this.responseHandled[id] in the error case.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Fixed PR comments.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* clean up response handled.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
2022-06-08 00:37:15 +04:00
..
ens-ipfs Deprecate extensionizer for webextension-polyfill (#13960) 2022-03-18 14:07:05 -05:00
migrator Add JSDoc ESLint rules (#12112) 2022-01-07 12:27:33 -03:30
rpc-method-middleware Event tracking for Token Detection V2 (#14441) 2022-05-11 16:27:58 -04:00
account-tracker.js Add JSDoc ESLint rules (#12112) 2022-01-07 12:27:33 -03:30
buy-url.js Add fiat onboarding for AVAX and MATIC through Wyre (#14683) 2022-05-27 11:04:26 -05:00
buy-url.test.js Add a new fiat onboarding option via MoonPay (#13934) 2022-03-21 10:26:52 +01:00
cleanErrorStack.js Add JSDoc ESLint rules (#12112) 2022-01-07 12:27:33 -03:30
cleanErrorStack.test.js Jestify app/scripts/lib/**/*.test.js (#12890) 2021-12-06 10:40:39 -06:00
ComposableObservableStore.js Add JSDoc ESLint rules (#12112) 2022-01-07 12:27:33 -03:30
ComposableObservableStore.test.js Jestify app/scripts/lib/**/*.test.js (#12890) 2021-12-06 10:40:39 -06:00
createLoggerMiddleware.js Add JSDoc ESLint rules (#12112) 2022-01-07 12:27:33 -03:30
createMetaRPCHandler.js Remove nodeify (#13003) 2021-12-08 18:06:53 -03:30
createMetaRPCHandler.test.js Remove nodeify (#13003) 2021-12-08 18:06:53 -03:30
createOnboardingMiddleware.js Deprecate extensionizer for webextension-polyfill (#13960) 2022-03-18 14:07:05 -05:00
createOriginMiddleware.js Add JSDoc ESLint rules (#12112) 2022-01-07 12:27:33 -03:30
createRPCMethodTrackingMiddleware.js MetaMetrics: Add EVENT.CATEGORIES const (#14474) 2022-04-22 13:09:10 -03:00
createStreamSink.js @metamask/eslint config@5.0.0 (#10358) 2021-02-04 10:15:23 -08:00
createTabIdMiddleware.js Add JSDoc ESLint rules (#12112) 2022-01-07 12:27:33 -03:30
decrypt-message-manager.js MetaMetrics: Add EVENT.CATEGORIES const (#14474) 2022-04-22 13:09:10 -03:00
encryption-public-key-manager.js MetaMetrics: Add EVENT.CATEGORIES const (#14474) 2022-04-22 13:09:10 -03:00
extractEthjsErrorMessage.js Add JSDoc ESLint rules (#12112) 2022-01-07 12:27:33 -03:30
get-first-preferred-lang-code.js Deprecate extensionizer for webextension-polyfill (#13960) 2022-03-18 14:07:05 -05:00
getObjStructure.js Add JSDoc ESLint rules (#12112) 2022-01-07 12:27:33 -03:30
local-store.js Deprecate extensionizer for webextension-polyfill (#13960) 2022-03-18 14:07:05 -05:00
message-manager.js MetaMetrics: Add EVENT.CATEGORIES const (#14474) 2022-04-22 13:09:10 -03:00
message-manager.test.js Jestify app/scripts/lib/**/*.test.js (#12890) 2021-12-06 10:40:39 -06:00
metaRPCClientFactory.js Add friendly error handling when background throws an error before listening for connection (#14461) 2022-06-08 00:37:15 +04:00
metaRPCClientFactory.test.js Add friendly error handling when background throws an error before listening for connection (#14461) 2022-06-08 00:37:15 +04:00
network-store.js Add JSDoc ESLint rules (#12112) 2022-01-07 12:27:33 -03:30
notification-manager.js Add JSDoc ESLint rules (#12112) 2022-01-07 12:27:33 -03:30
personal-message-manager.js MetaMetrics: Add EVENT.CATEGORIES const (#14474) 2022-04-22 13:09:10 -03:00
personal-message-manager.test.js Jestify app/scripts/lib/**/*.test.js (#12890) 2021-12-06 10:40:39 -06:00
seed-phrase-verifier.js Update SRP representation 2022-03-30 21:01:26 -02:30
seed-phrase-verifier.test.js Jestify app/scripts/lib/**/*.test.js (#12890) 2021-12-06 10:40:39 -06:00
segment.js Update segment instantiation check. Only check if SEGMENT_WRITE_KEY exists (#14407) 2022-04-14 18:31:54 -03:00
setupSentry.js Restore version missing from certain build steps (#14344) 2022-04-04 21:06:12 -02:30
stream-utils.js Add JSDoc ESLint rules (#12112) 2022-01-07 12:27:33 -03:30
typed-message-manager.js MetaMetrics: Add EVENT.CATEGORIES const (#14474) 2022-04-22 13:09:10 -03:00
typed-message-manager.test.js Jestify app/scripts/lib/**/*.test.js (#12890) 2021-12-06 10:40:39 -06:00
util.js Use externally hosted phishing warning page 2022-05-16 14:40:50 -02:30
util.test.js Use externally hosted phishing warning page 2022-05-16 14:40:50 -02:30