Skip to content
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

feat: add deleteAfterResult option to approval controller #4715

Merged
merged 2 commits into from
Sep 19, 2024

Conversation

matthewwalsh0
Copy link
Member

@matthewwalsh0 matthewwalsh0 commented Sep 19, 2024

Explanation

Currently, when accepting an approval request with the ApprovalController, the request is removed from the state as soon as accept is called.

This adds an optional deleteAfterResult option which (if waitForResult is also set) retains the approval request in the state until a result callback is invoked by the creator of the approval request.

Since the clients typically route based on the presence of an approval request in the state, this can simplify some scenarios where the route or component is needed until all the approval request related processing is complete.

This also aligns with the current ApprovalController patch in the mobile client.

References

Changelog

@metamask/approval-controller

  • ADDED: Add deleteAfterResult option to accept method to delay removal of approval request from state.

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

@matthewwalsh0 matthewwalsh0 merged commit d88e706 into main Sep 19, 2024
116 checks passed
@matthewwalsh0 matthewwalsh0 deleted the feat/approval-controller-delete-after-result branch September 19, 2024 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants