* feat: update sentry mask adding controller props to improve error monitoring
* fix:remove changes in chrome-driver dependency
* Remove properties from mask
* Add more values to mask
* Sort the mask alphabetically
* Add termsOfUseLastAgreed to mask
* Fix test imports
* Update policy gap test to compare UI mask
* Reorganize tests under one describe block
* Update snapshots
* Mask another timestamp in state snapshots
* Mask browser environment properties
* Add missing UI field mask, and refactor field masking/removal
* Eliminate remaining policy gaps
* Simplify ganache options
* Eliminate extra mask properties
* Update mask to capture dynamic keys
The mask now supports dynamic keys. This lets set more fine-grained rules
for which data to include within dynamic data structures.
The mask has been updated to include just top-level keys for various
token-related data collections in state. This lets us see the chain IDs
that users have tokens on. This will be useful in debugging Sentry
reports of invalid keys in these data structures.
* Add additional 'expected missing state' entries
* Remove unnecessary properties from state snapshot
* Add providerConfig.chainId to state snapshot
* Update error state snapshots
---------
Co-authored-by: Danica Shen <zhaodanica@gmail.com>
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
* Split out advanced gas fees by network and delete old values
* use arrow functions in preferences test
* changes
* added back priorityFeeProperCase to en messages
* update types
* remove case change
* fix(privateKey): Restore hold-to-reveal button for private key export
* lint and unit test fixes
* adding e2e tests to reveal private key
* fixing lint issues
* fixed: Private key is able to be presented without tapping and holding the "Hold to reveal" CTA
* Incorrect password test and support hold to reveal
* improving unit tests
---------
Co-authored-by: Plasma Corral <32695229+plasmacorral@users.noreply.github.com>
Co-authored-by: Gustavo Antunes <17601467+gantunesr@users.noreply.github.com>
* feat(878): implement new incoming transaction toggle networks for setting and onboarding
* Update state snapshots
* feat(878): change gaps, migration types based on comment
---------
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
Remove the IncomingTransactionController and replace it with an internal helper class.
Move incoming transactions into the central transactions object.
Create a new RemoteTransactionSource interface to decouple incoming transaction support from Etherscan.
Split the incoming transaction logic into multiple files for easier maintenance.
The Sentry e2e state snapshots now mask the application version and
migration version, ensuring that the snapshots don't need a extra
update in each release candidate branch and post-release sync branch.
The values are masked rather than removed so that the test still shows
they are present in error reports, where they can be quite useful for
diagnostic purposes.
* BannerBase to TS
* snapshot updates
* more snapshot updates
* addressing type definition error
* updating eth-sign-modal snapshot
* Updates to stories, types and adding data-testid
* Updating snapshots
* updating snapshot of blockaid-banner-alert and adding unit test for childrenWrapperProps
* BannerBase updates to stories, adding locale for close button, removing static data-testid in favor of using it at the instance, updating snapshots associated with those changes
* Removing incorrect arg from storybook file
* Updating html element in security provider e2e test to match BannerBase. Also updating snapshot of ConfirmTransaction page
* Fixing e2e tests
---------
Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
* Fix and test log.info calls run for each migration
In migrator/index.js, log.info is called before an after each migration.
These calls are intended to produce breadcrumbs to be captured by sentry
in cases where errors happen during or shortly after migrations are run.
These calls were not causing any output to the console because the log.setLevel
calls in ui/index.js were setting a 'warn value in local storage that was being
used by logLevel in the background.
This commit fixes the problem by setting the `persist` param of setLevel to
false, so that the background no longer reads the ui's log level.
Tests are added to verify that these logs are captured in sentry breadcrumbs
when there is a migration error due to an invariant state.
* Improve breadcrumb message matching
The test modified in this commit asserts eqaulity of messages from breadcrumbs
and hard coded expected results. This could cause failures, as sometimes the
messages contain whitespace characters. This commit ensures the assertions only
check that the expected string is within the message string, ignoring extra
characters.
The E2E test scripts now have a flag for updating E2E test snapshots.
The flag has been documented as well. This makes it easier to update
snapshots and raises visbility of this feature.
* Initialize composable observable store after update
The composable observable store now updates state immediately when the
structure is updated. Previously each store would only be updated after
the first state change. This ensures that the composable observable
store state is always complete.
* SUpport falsy controller state
We now use the nullish coalescing operator when checkint store.state, so that we don't accidentally ignore falsy state.
Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
* Add test for falsy controller state
* Update state snapshots
A change on `develop` required another state update.
---------
Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
* Enable Snaps feature flag in stable
* Run snaps E2Es in stable
* Fix CI config indentation
* Fix CI paths
* Update LavaMoat policies
* Update iframe URL
* Exclude some tests from running in stable e2e
* Disable another test on stable
* Bump to 1.0.1
* Fix config.yml issue due to staleness
* Stop running newly added test
* Update snapshots used for E2E
* Use shallow-git-clone
* Improve Sentry state pre-initialization
Previously the masked state snapshot sent to Sentry would be blank for
errors that occured during initialization. Instead we'll now include
some basic information in all cases, and a masked copy of the persisted
state if it happens after the first time the persisted state is read.
* Add test
* Fix crash when persisted state not yet fetched
* Add descriptions for initial state hooks
* Update comments to reflect recent changes
* Re-order imports to follow conventions
* Move initial state hooks back to module-level
The initial state hooks are now setup at the top-level of their module.
This ensures that they're setup prior to later imports. Calling a
function to setup these hooks in the entrypoint module wouldn't
accomplish this even if it was run "before" the imports because ES6
imports always get hoisted to the top of the file.
The `localStore` instance wasn't available statically, so a new state
hook was introduced for retrieving the most recent retrieved persisted
state.
* Fix error e2e tests
Migration #77 would set the `TokenListController.tokensChainsCache`
state to `undefined` if it wasn't already set to anything when that
migration was run. This is probably harmless except that it results
in Sentry errors during migrations, and it results in that property
having a value (at least temporarily) that doesn't match its type.
Migration #77 has been updated to prevent this property from being
set to `undefined` going forward. A new migration has been added to
delete this value for any users already affected by this problem. The
new migration was named "92.1" so that it could run after 92 but before
93, to make backporting this to v10.34.x easier (v10.34.x is currently
on migration 92). "92.1" is still a valid number so this should work
just as well as a whole number.
* Add types of hidden properties to Sentry data
The masked wallet state object sent to Sentry has been updated to
include the type of each property omitted from the mask. This lets us
at least see the full state shape, making it easier to see when errors
are caused by invalid state.
Relates to #20449
* Remove inconsistent state snapshot properties
The state snapshot tests have been updated to exclude properties that
were shown to differ between runs.
The unflattened background state is now attached to any Sentry errors
from the background process. This provides a clearer picture of the
state of the wallet, and unblocks further improvements to Sentry state
which will come in later PRs.
The state fixtures in the Sentry e2e tests became invalid in #20458
due to a conflict with that change (the new state properties were
missing). The state fixtures have been updated.
* Reorganize Sentry error e2e tests
The tests have been reorganized into different describe blocks. Each
describe block is for either before or after initialization, and either
with or without opting into metrics.
This was done to simplify later test additions. The conditions for each
test are now in the describe block, letting us test additional things
in each of these conditions. The conditions were flattened to a single
level to avoid excessive indentation.
* Add error e2e test for background and UI errors
The Sentry e2e tests before initialization only tested background
errors, and the after initialization tests only tested UI errors. Now
both types of errors are tested in both scenarios.
* Add error e2e tests for Sentry error state
E2E tests have been added to test the state object sent along with each
Sentry error.
At the moment this object is empty in some circumstances, but this will
change in later PRs.
* Rename throw test error function
* Only setup debug/test state hooks in dev/test builds
The state hooks used for debugging and testing are now only included in
dev or test builds. The function name was updated and given a JSDoc
description to explain this more clearly as well.
* Add state snapshot assertions
State snapshot assertions have been added to the e2e error tests. These
snapshots will be very useful in reviewing a few PRs that will follow
this one.
We might decide to remove these snapshots after this set of Sentry
refactors, as they might be more work to maintain than they're worth.
But they will be useful at least in the short-term.
The login step has been removed from a few tests because it introduced
indeterminacy (the login process continued asynchronously after the
login, and sometimes was not finished when the error was triggered).
* Ensure login page has rendered during setup
This fixes an intermittent failure on Firefox
* Format snapshots with prettier before writing them
* Use defined set of date fields rather than infering from name
* Remove waits for error screen
The error screen only appears after a long timeout, and it doesn't
affect the next test steps at all.
* Replaced ActionableMessage component in srp-input
* Modified value of Severity in srp-input/BannerAler
* fixed lint error
* Updateddata-testid in banner and test/e2e/helpers.js
* Updated className with prefix
---------
Co-authored-by: George Marshall <george.marshall@consensys.net>
* Add Token To into assets again (reverting commit 51f46eb65f48bdf4980f400a589bf1ac63a65222 )
* Update cleanup for an unswapped Token To from the Tokens list
* Call "setLatestAddedTokenTo" conditionally
* Update an E2E test for insufficient balance notification
* Capture Sentry errors prior to initialization
Sentry errors captured before/during the wallet initialization are
currently not captured because we don't have the controller state yet
to determine whether the user has consented.
The Sentry setup has been updated to check the persisted state for
whether the user has consented, as a fallback in case the controller
state hasn't been initialized yet. This ensures that we capture errors
during initialization if the user has opted in.
* Always await async check for whether the user has opted in
* Remove unused import
* Update JSDoc return type
* Remove unused driver method
* Fix metametrics controller unit tests
* Fix e2e tests
* Fix e2e test on Firefox
* Start session upon install rather than toggle
* Update phishing controller to v4.0.0
* Move phishing e2e test utilities into its own helper.js
* Update phishing detection e2e test
* Update MetaMask Controller test mocks
* Update mv3 phishing tests
* Fix test for 500 error on warning page
* Allow for directories in test folder
* Update migration number
* Linting fixes
* Remove fail on console error
* Separate mocks from helpers
* Have migration delete PhishingController state entirely
* Remove phishing detection directory
* Only delete the listState in migration
* Bump migration version
* update transaction status to not be considered anonymous
* fix failing e2e
* revert status changes in txn spec file
* Fix e2e by adding status
---------
Co-authored-by: Olusegun Akintayo <akintayo.segun@gmail.com>
* Allow user to turn off IPFS gateway resolution
* Add end to end test for toggle on and off
* Fix jest tests and snapshots
* Change variable name
* Implement provided content
* Use MetaMask eth instead
* Allow searching for ENS setting
* Fix jest
---------
Co-authored-by: Brad Decker <bhdecker84@gmail.com>
* eth_call test
* eth_chainId test
* run json rpc tests
* add ci job
* remove query string param from url
* eth_sendTransaction test
* eth_sendTransaction test
---------
Co-authored-by: Brad Decker <bhdecker84@gmail.com>
* Add improved downloading logic when exporting state logs
* Make test for state logs download only apply to firefox
* Remove eslint override
* Add file extension to test
* Move make jest global.Blob accessible to window
* initial fixes to E2Es
* changed test website
* final E2E fixes
* fixed getentropy test
* missing scroll fix
* scrollfix for bip44 firefox
* added new function and edited tests