feat(kyc-controller): throw on previously silently handled errors - #10214
Open
jiexi wants to merge 3 commits into
Open
feat(kyc-controller): throw on previously silently handled errors#10214jiexi wants to merge 3 commits into
jiexi wants to merge 3 commits into
Conversation
Member
Author
|
@metamaskbot publish-previews |
Co-authored-by: Cursor <cursoragent@cursor.com>
Member
Author
|
@metamaskbot publish-preview |
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
References
Checklist
Note
Medium Risk
Breaking public API for KycController consumers that assumed resolved promises on KYC check and consents-session failures; behavior change in MoonPay post-auth auto-run error propagation.
Overview
BREAKING: Several KYC controller paths that used to fail quietly now rethrow the original error after writing failure details to state, so callers can use
try/catchorawaitrejection handling instead of only inspectingphase/error.checkKycRequiredstill setsphase: 'error'on service failure but no longer returnsfalse; it propagates the error. On product-scoped MoonPay flows, that meansonAuthenticated/ frame-message continuation rejects when the auto KYC-required check fails, whilestartSumSubfailures remain swallowed in that continuation (state-only).The consents-path session (
#startConsentsSession, reached fromacceptTermsAndStartSessionor a resumedinitialize) still rewinds totermsand records a consents error, then rethrows so Iron/non-MoonPay session failures surface to the caller.Tests and JSDoc/changelog document the new throw behavior; validation via
#fail(missing token/email/country) and superseded in-flight work afterreset()are unchanged.Reviewed by Cursor Bugbot for commit 740420d. Bugbot is set up for automated code reviews on this repo. Configure here.