Skip to content

🚑️ app: prevent range error in asset amount formatting#929

Merged
cruzdanilo merged 1 commit intomainfrom
hotfix
Apr 1, 2026
Merged

🚑️ app: prevent range error in asset amount formatting#929
cruzdanilo merged 1 commit intomainfrom
hotfix

Conversation

@franm91
Copy link
Copy Markdown
Member

@franm91 franm91 commented Mar 31, 2026


Open with Devin

Summary by CodeRabbit

  • Bug Fixes
    • Prevents a range error when formatting asset amounts to avoid crashes or rendering failures.
    • Improves asset balance formatting so small and large balances use appropriate fractional digits, ensuring consistent, readable display of asset values across magnitudes.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 31, 2026

🦋 Changeset detected

Latest commit: aa337f7

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 31, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 164faaf4-85a3-4502-a9b3-d8b8be2ba632

📥 Commits

Reviewing files that changed from the base of the PR and between 5301462 and aa337f7.

📒 Files selected for processing (2)
  • .changeset/dry-gnu-run.md
  • src/components/home/AssetList.tsx

Walkthrough

Adds a patch changeset for @exactly/mobile and updates asset amount formatting in the home asset list: computes a derived precision (digits) from token decimals and usdValue magnitude, and uses it for both minimum and maximum fraction digits when formatting balances.

Changes

Cohort / File(s) Summary
Changeset Documentation
.changeset/dry-gnu-run.md
Adds a patch changeset entry for @exactly/mobile noting a fix to avoid a range error when formatting asset amounts.
Asset Amount Formatting
src/components/home/AssetList.tsx
Introduces a computed digits based on decimals and the magnitude of usdValue (via log10(usdValue / 1e18), clamped and capped at 8). Uses digits for both minimumFractionDigits and maximumFractionDigits, with minimumFractionDigits clamped to at least 1. Reorders destructuring to compute digits after extracting usdValue/decimals. No other rendering or control flow changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • dieguezguille
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: preventing a range error in asset amount formatting, which is reflected in the code changes to AssetList.tsx's digit calculation logic.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hotfix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

gemini-code-assist[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

sentry[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@sentry
Copy link
Copy Markdown

sentry bot commented Mar 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.62%. Comparing base (b6fb45d) to head (aa337f7).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #929   +/-   ##
=======================================
  Coverage   71.62%   71.62%           
=======================================
  Files         228      228           
  Lines        8233     8234    +1     
  Branches     2642     2642           
=======================================
+ Hits         5897     5898    +1     
  Misses       2106     2106           
  Partials      230      230           
Flag Coverage Δ
e2e 71.62% <100.00%> (+19.20%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cruzdanilo cruzdanilo force-pushed the hotfix branch 2 times, most recently from 5301462 to 5f1d320 Compare April 1, 2026 21:59
@cruzdanilo cruzdanilo merged commit aa337f7 into main Apr 1, 2026
16 of 18 checks passed
@cruzdanilo cruzdanilo deleted the hotfix branch April 1, 2026 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants