-
Notifications
You must be signed in to change notification settings - Fork 80
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(jumpstart): add specific error messaging when link is already claimed #5427
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5427 +/- ##
==========================================
+ Coverage 86.20% 86.27% +0.06%
==========================================
Files 748 753 +5
Lines 30474 30688 +214
Branches 5196 5243 +47
==========================================
+ Hits 26271 26475 +204
- Misses 3975 3985 +10
Partials 228 228
... and 29 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
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.
general comment about distinguishing error types, but no changes needed :)
Logger.error(TAG, 'Error handling jumpstart link', error) | ||
ValoraAnalytics.track(JumpstartEvents.jumpstart_claim_failed) | ||
yield* put(jumpstartClaimFailed()) | ||
yield* put( |
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.
I think the pattern of parsing the error message to determine the error type is prolly fine here, since we're only discerning between two types of error, though in general this does seem like it has the potential to break stuff if we're not careful... e.g. if i'm adding a new error, i have to know that it can't contain certain substrings else other code will interpret it as a certain "kind" of error. one alternative is having some custom error type that we stick some error enum value on, which eliminates that confusion.
i think for this case it's fine since this is simple and we prolly won't add more error types, but wanted to call it out since i've definitely run into error-parsing-hell when dealing with handling errors from external libs that are only distinguished by their (inconsistently formatted) messages.
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.
yeah good shout, this is a fair point. i've been mulling this over but i think there's always going to be some level of brittleness with error handling here because there are multiple points that the claim flow can throw (including when we generate the transaction and when we make the network request to claim the transaction). so we don't have control over every error that can exist, and (afaik) it's not possible to enforce any checks on exactly which errors are thrown (i.e. we can declare a map of custom errors, but that relies on the sagas actually using the map when creating the errors) which at least for now seems like extra effort but still leaves the door open for us to screw this up in the future. so i guess for now my preference would be to leave it as is and think about it more when we add more custom errors - i'm not sure that is likely :)
Description
As the title
Test plan
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-05-17.at.10.47.07.mp4
Related issues
Backwards compatibility
Y
Network scalability
If a new NetworkId and/or Network are added in the future, the changes in this PR will: