-
Notifications
You must be signed in to change notification settings - Fork 105
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
chore(IT Wallet): [SIW-2022] Increased serialization for unexpected errors during eID issuance #6770
base: master
Are you sure you want to change the base?
Conversation
PR Title Validation for conventional commit type✅ All good! PR title follows the conventional commit type. |
Jira Pull Request LinkThis Pull Request refers to Jira issues: |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6770 +/- ##
==========================================
+ Coverage 41.94% 51.04% +9.10%
==========================================
Files 1429 1583 +154
Lines 29960 32723 +2763
Branches 6662 7355 +693
==========================================
+ Hits 12566 16703 +4137
+ Misses 17364 15973 -1391
- Partials 30 47 +17
... and 448 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
* To maintain compatibility with the existing failure tracking, we keep the original `failure` object when `failure.reason` is not empty. | ||
*/ | ||
return trackItwIdRequestUnexpectedFailure( | ||
!failure.reason || Object.keys(failure.reason as object).length === 0 |
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.
If there is no failure.reason
does it make sense to call serializeFailureReason
? There should be nothing to serialize.
And do we really need to cast as object
?
Short description
This PR aims to enhance the reason, in the Mixpanel tracking, for errors during eID issuance that fall under
IssuanceFailureType.UNEXPECTED
.Some unexpected errors in the reason field on Mixpanel report as
{"jsEngine":"hermes"}
. Unfortunately, this error is not descriptive, making it difficult to understand what the actual issue was.List of changes proposed in this pull request
trackItwIdRequestUnexpectedFailure
function to verify iffailure.reason
isempty
If
failure.reason
isempty
, theserializeFailureReason
function (already used in theuseItwFailureSupportModal
hook) is utilized; otherwise, the current behavior is maintained.How to test
Testing with Non-Empty Object
io-react-native-wallet
package locally, you can simulate an unexpected error by throwingthrow new AuthorizationIdpError("access_denied", "ErrorCode nr21: Timeout during user authentication");
{"code":"ERR_IO_WALLET_IDENTIFICATION_RESPONSE_PARSING_FAILED","error":"access_denied","errorDescription":"ErrorCode nr21: Timeout durante l'autenticazione utente","jsEngine":"hermes","name":"AuthorizationIdpError"}
Testing Serialization Enhancement
Network request failed
. In detail, the error appears as{"reason": [TypeError: Network request failed], "type": "UNEXPECTED"}
. Previously, this error was reported on Mixpanel with the reason as{"jsEngine":"hermes"}
.{“jsEngine”: “hermes”}
as reason, probably has an empty object asfailure.reason
, butfailure.reason.message
is populated. With the recent changes, the reason on Mixpanel should now correctly show the reason