-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
fix: app crash due to minimal input must be string error #10842
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. |
Bitrise❌❌❌ Commit hash: 360e1de Note
|
1389d37
to
16adeec
Compare
Bitrise✅✅✅ Commit hash: 16adeec Note
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10842 +/- ##
==========================================
+ Coverage 52.75% 52.83% +0.07%
==========================================
Files 1534 1542 +8
Lines 36777 36887 +110
Branches 4335 4361 +26
==========================================
+ Hits 19403 19488 +85
- Misses 16058 16071 +13
- Partials 1316 1328 +12 ☔ View full report in Codecov by Sentry. |
16adeec
to
f630624
Compare
Bitrise❌❌❌ Commit hash: f630624 Note
|
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.
This kind of bug definitely makes me want to get util/number/index.js
refactored to Typescript 😅 but, it seems like this would be a tough file to convert.
Your description makes sense. I wonder if a more long term fix would be to address this in the fromTokenMinimalUnitString
function itself? I'm not sure if forcing a fallback to '0'
is acceptable here during send flow (maybe someone on Txn team can confirm if it is).
In any case, I think that we should probably write some unit tests to check for the cases you described in your PR description in util/number/index.test.ts
to make sure that each function gets evaluated as we'd expect them to.
9893448
to
8fa9175
Compare
Bitrise❌❌❌ Commit hash: 8fa9175 Note
|
Bitrise✅✅✅ Commit hash: 3ae5fbb Note
|
Quality Gate passedIssues Measures |
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.
LGTM
Description
This PR addresses the "minimal input must be string" error thrown by the
fromTokenMinimalUnitString
function when its first argument is not a string. This error causes a crash on the user's device.Error logs from Senty point to the Send Flow. These changes help ensure that the
fromTokenMinimalUnitString
function always receives astring
by using the hex fallback0x0
. This will stop theminimal input must be string
error and associated app crashesRelated issues
Fixes: #9077
Manual testing steps
Screenshots/Recordings
NA
Before
NA
After
NA
Pre-merge author checklist
Pre-merge reviewer checklist