Skip to content

🐛 app: misc fixes#1028

Merged
cruzdanilo merged 3 commits into
mainfrom
fixes
May 21, 2026
Merged

🐛 app: misc fixes#1028
cruzdanilo merged 3 commits into
mainfrom
fixes

Conversation

@dieguezguille
Copy link
Copy Markdown
Member

@dieguezguille dieguezguille commented May 21, 2026

Summary by CodeRabbit

  • Bug Fixes

    • Fixed bridge fee estimation calculations
    • Filtered unverified tokens from portfolio display
    • Batched token approval into bridge submission to reduce failed approval races
  • Improvements

    • Enhanced cross-chain fee estimation accuracy
  • Chores

    • Added release notes entries documenting these patch changes

Review Change Stack

@dieguezguille dieguezguille self-assigned this May 21, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 21, 2026

🦋 Changeset detected

Latest commit: 3a93b05

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

This PR includes changesets to release 1 package
Name Type
@exactly/mobile Patch

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 May 21, 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: a73c0d9c-f64f-4029-b75f-0dd013c54d44

📥 Commits

Reviewing files that changed from the base of the PR and between 7180c37 and 3a93b05.

📒 Files selected for processing (6)
  • .changeset/dark-yaks-care.md
  • .changeset/fluffy-bobcats-rhyme.md
  • .changeset/light-wings-trade.md
  • src/components/add-funds/Bridge.tsx
  • src/utils/accountClient.ts
  • src/utils/lifi.ts

Walkthrough

Adds three patch changesets and implements: LI.FI-backed token filtering for wallet balances, batching of paymaster ERC-20 approvals into the bridge sendCallsTx, and Alchemy-based fee estimation for cross-chain SmartAccount clients.

Changes

Bridge and portfolio refinements

Layer / File(s) Summary
Release changesets
.changeset/*
Three changeset entries documenting patch releases for @exactly/mobile (bridge fee estimation fix, unverified token filtering, approval batching).
Portfolio token verification
src/utils/lifi.ts
Balance fetching now parallelizes a LI.FI token metadata fetch and filters per-chain token balances to only tokens present in LI.FI's list (chainId + case-insensitive address).
Bridge paymaster approval batching
src/components/add-funds/Bridge.tsx
executeBridge now conditionally ABI-encodes an ERC-20 approve(paymasterAddress, maxUint256) as paymasterApproval and prepends it to the sendCallsTx calls batch; catch/retry behavior adjusted for auth and exa-sender cases.
Cross-chain fee estimation
src/utils/accountClient.ts
Imports alchemyFeeEstimator and configures a cross-chain SmartAccountClient feeEstimator using remote.alchemyTransport, setting feeOptions.maxPriorityFeePerGas.multiplier to 1.5 when context is absent.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • exactly/exa#1020: The Bridge.tsx batching changes align with paymaster-aware bridge flow and Alchemy gas-policy context handling.

Suggested reviewers

  • franm91
  • cruzdanilo
🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title uses vague phrasing ('misc fixes') that doesn't convey specific information about the changes, despite the emoji indicating a bug fix category. Replace 'misc fixes' with specific details about the main changes, such as 'batch fee token approval, improve token filtering, and fix bridge fee estimation'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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 fixes

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.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces several improvements to the mobile application, including batching fee token approvals into bridge transactions, enhancing bridge fee estimation with a dedicated estimator and multiplier, and filtering unverified tokens from the portfolio using Li.Fi data. Feedback identifies a critical issue where batching the paymaster approval into the same UserOperation as the bridge call will likely cause validation failures, as paymasters typically verify allowances before the execution phase. Additionally, a performance optimization is suggested to avoid recreating a large Set of tokens during frequent balance refreshes.

Comment on lines +536 to +538
...(paymasterFee && paymasterApproval
? [{ to: getAddress(paymasterFee.token.address), data: paymasterApproval }]
: []),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Batching the ERC-20 paymaster approval into the same UserOperation as the bridge call will likely cause the transaction to fail during the validation phase. Most ERC-4337 paymasters (including Alchemy's) check the allowance in validatePaymasterUserOp. Since the execution of the batched approve call only happens after successful validation, the paymaster will see a zero allowance and reject the UserOperation. This will trigger the fallback logic at line 584, causing the app to always use sponsored gas instead of the intended fee token when an approval is required.

Comment thread src/utils/lifi.ts
})
: undefined,
]);
const known = new Set(lifiTokens.map((token) => `${token.chainId}:${token.address.toLowerCase()}`));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Creating a new Set by mapping over the entire lifiTokens array (which can contain thousands of items) on every balance refresh (every 30 seconds) may impact performance on mobile devices. Consider memoizing this Set or moving the transformation logic into the lifiTokensOptions query using the select option to avoid redundant processing.

References
  1. Prefer inline mappings for simple, self-contained data transformations instead of extracting them into constants.

@sentry
Copy link
Copy Markdown

sentry Bot commented May 21, 2026

Codecov Report

❌ Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.89%. Comparing base (34ddc33) to head (3a93b05).
⚠️ Report is 4 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/utils/lifi.ts 0.00% 8 Missing ⚠️
src/utils/accountClient.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1028      +/-   ##
==========================================
- Coverage   73.84%   72.89%   -0.95%     
==========================================
  Files         243      243              
  Lines       10787    10343     -444     
  Branches     3653     3407     -246     
==========================================
- Hits         7966     7540     -426     
+ Misses       2516     2499      -17     
+ Partials      305      304       -1     
Flag Coverage Δ
e2e 72.89% <0.00%> (-0.95%) ⬇️

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.

@dieguezguille
Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 21, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cruzdanilo cruzdanilo merged commit 3a93b05 into main May 21, 2026
12 of 14 checks passed
@cruzdanilo cruzdanilo deleted the fixes branch May 21, 2026 19:59
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