-
-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: transaction controller startup #4658
Conversation
Remove initApprovals method. Export mobile constants. Fail approved transactions on startup. Improve gas fee poller error logging.
Skip validation when failing transaction. Remove approve during resubmit. Add updated rawTx to retry transactions. Fix resubmit after transaction fails.
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
Thoughts on splitting this into multiple PRs? These changes seem like they would be easy to do separately, and seem unrelated to the initialization changes:
|
I absolutely can if required. But they are each just one line changes so wanted to avoid the admin overhead. |
Since b both changes serve a distinct purpose, it would be preferred to make them separately even they are only 1-line changes, as suggested by the contributor docs. Certainly these changes don't contribute much to the size of the PR, so they aren't problematic for that reason. But if we're reviewing the commit history to understand what changed, these would not appear. And similarly if we found a bug with the initialization refactor and wanted to revert it, it would also revert these two small changes unnecessarily, which is prevented by separating them. |
Explanation
Refactor the handling of incomplete transactions when initialising the
TransactionController
.unapproved
transactions are now removed entirely and theinitApprovals
method has been removed.initApprovals
method allowed the clients to re-trigger approval requests and ultimately transaction confirmations.approved
transactions are now marked asfailed
.signed
transactions are now marked asfailed
.In addition:
approveTransaction
flow inPendingTransactionTracker
.rawTx
to cancel and speed up transactions.References
Fixes #23361
Changelog
@metamask/transaction-controller
initApprovals
method.beforeApproveOnInit
hook.unapproved
transactions during initialisation.approved
andsigned
transactions during initialisation.Checklist