-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
chore: cp-7.52.0 match extension implementation of validation/simulation error details #17518
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
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
|
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Error Handling Mixes API Structures
The error handling logic inconsistently mixes new and old API response structures. While the primary error check now uses validationResult.status === 'ERROR', the code still attempts to access validationResult.result.validation.reason and validationResult.error for fallback messages and error type determination. If these older properties are undefined in the new API structure, the errorMessage passed to the error modal can become undefined, leading to display issues. Additionally, the hardcoded "The " prefix and "." suffix around error_details.message can result in grammatically incorrect or redundant error messages.
app/components/UI/Bridge/Views/BridgeView/index.tsx#L282-L297
metamask-mobile/app/components/UI/Bridge/Views/BridgeView/index.tsx
Lines 282 to 297 in 052be77
| }); | |
| if (validationResult.status === 'ERROR') { | |
| displayValidationError = true; | |
| const isValidationError = | |
| !!validationResult.result.validation.reason; | |
| const { error_details } = validationResult; | |
| const fallbackErrorMessage = isValidationError | |
| ? validationResult.result.validation.reason | |
| : validationResult.error; | |
| navigation.navigate(Routes.BRIDGE.MODALS.ROOT, { | |
| screen: Routes.BRIDGE.MODALS.BLOCKAID_MODAL, | |
| params: { | |
| errorType: isValidationError ? 'validation' : 'simulation', | |
| errorMessage: error_details?.message | |
| ? `The ${error_details.message}.` | |
| : fallbackErrorMessage, |
Was this report helpful? Give feedback by reacting with 👍 or 👎
|
|
|
No release label on PR. Adding release label release-7.52.0 on PR, as PR was cherry-picked in branch 7.52.0. |
10 similar comments
|
No release label on PR. Adding release label release-7.52.0 on PR, as PR was cherry-picked in branch 7.52.0. |
|
No release label on PR. Adding release label release-7.52.0 on PR, as PR was cherry-picked in branch 7.52.0. |
|
No release label on PR. Adding release label release-7.52.0 on PR, as PR was cherry-picked in branch 7.52.0. |
|
No release label on PR. Adding release label release-7.52.0 on PR, as PR was cherry-picked in branch 7.52.0. |
|
No release label on PR. Adding release label release-7.52.0 on PR, as PR was cherry-picked in branch 7.52.0. |
|
No release label on PR. Adding release label release-7.52.0 on PR, as PR was cherry-picked in branch 7.52.0. |
|
No release label on PR. Adding release label release-7.52.0 on PR, as PR was cherry-picked in branch 7.52.0. |
|
No release label on PR. Adding release label release-7.52.0 on PR, as PR was cherry-picked in branch 7.52.0. |
|
No release label on PR. Adding release label release-7.52.0 on PR, as PR was cherry-picked in branch 7.52.0. |
|
No release label on PR. Adding release label release-7.52.0 on PR, as PR was cherry-picked in branch 7.52.0. |



Description
Matches the existing implementation of error details in extension.
Changelog
CHANGELOG entry:
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist