fix(activity): stuck confirmation on back after tx + missing lending deposit token icon cp-8.3.0#33157
Conversation
Lending deposit rows derived their token from the pool contract (txParams.to) instead of the underlying deposited asset, so the Activity row had no resolvable icon, symbol, or amount. Resolve the supplied token from simulation data / the outgoing Transfer log (falling back to the pool address), and enrich lending token metadata from the tokens API so the row shows the correct avatar and amount. TMCU-1082
…ter a transaction After a full-screen confirmation submitted, the redirect pushed the Activity screen on top of the now-consumed confirmation (approval deleted via deleteAfterResult), so pressing back returned to it and it rendered an infinite loader. A new navigateToActivityAfterConfirmation helper replaces the confirmation's stack with Activity in a single StackActions.replace, avoiding the stale screen and the pop+push double-animation. Wired into the shared transaction confirm hook, batch approvals, the Earn lending deposit/withdrawal views, and the legacy staking footer. TMCU-1001
|
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. |
PR template — items to address before "Ready for review"Warnings — informational, address before merging:
See docs/readme/ready-for-review.md for the full Definition of Ready for Review. |
🧪 Flaky unit test detectionRun history flaky detectionHistorical failure rate is a hint, not proof — review each suggestion in context. See the flaky-test-detection skill for the full pattern reference and manual audit workflow. Failures / runs sampled per window:
AI-detected flaky patterns
|
…ot route StackActions.replace(TRANSACTIONS_VIEW) only resolves when Activity is registered on the root navigator (Money-account enabled). When the flag is off, Activity lives under the tabs, so guard on the root routeNames and fall back to a plain navigate() to match the prior behavior. Adds unit coverage for the replace / navigate / no-parent branches. Addresses Cursor Bugbot review. TMCU-1001
…token from logs The post-confirmation receipt-log fallback matched the first outgoing ERC-20 Transfer sent from the user, which could pick an unrelated transfer (e.g. a gas-fee token) earlier in the log. Also require the recipient to be the pool (txParams.to) so it matches the actual deposit transfer. Addresses Cursor Bugbot review. TMCU-1082
…mcu-1001-activity-confirmation-back-navigation
…transfer for lending deposit token Requiring the Transfer recipient to equal the pool (txParams.to) missed the real deposit log for Aave V3, which sends the underlying from the user to the reserve aToken rather than to the pool address. Instead, prefer a transfer to the pool when present (to disambiguate from an unrelated outgoing transfer such as a gas-fee token) and otherwise fall back to the first outgoing transfer from the user. Addresses the follow-up Cursor Bugbot finding. TMCU-1082
…y details screen The Activity transaction details screen (SwapDetails template) rendered the lending deposit amount and its fiat total from the raw token without applying decimals (e.g. -10,000 / $9,991.95 instead of -0.01 / ~$0.01), because it never enriched the token's decimals the way the Activity list row does. Enrich the source/destination token decimals from the tokens API in SwapDetails so both the amount and the fiat total resolve correctly. Moves the shared enrichTokenFromApi helper into activity-list-helpers (re-exported from the package index) with direct unit tests, and adds SwapDetails coverage. TMCU-1082
…lint:tsc findings - Extract the nested ternaries for the primary token and avatar tokens in useActivityListItemRowContent into if/else statements (SonarCloud). - Remove the now-unused Routes imports from the Earn lending deposit/withdrawal views (SonarCloud). - Fix the lint:tsc error in the lending deposit receipt-log fallback by destructuring the topic elements instead of passing the whole topics array to the helper.
…mcu-1001-activity-confirmation-back-navigation
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: The PR introduces several interconnected changes:
Tag selection rationale:
Per tag descriptions: SmokeSwap and SmokeStake both require SmokeConfirmations (already selected). SmokeMoney flows that execute swaps also require SmokeSwap and SmokeConfirmations (already selected). Performance Test Selection: |
|
| // `replace` only resolves when Activity is a root-stack screen (Money-account | ||
| // enabled — the case with the bug). Otherwise fall back to plain `navigate`. |
There was a problem hiding this comment.
Nit: We can probably remove the feature-specific comment since this is a generic nav util.
There was a problem hiding this comment.
Good callout. I'll remove these in a follow up PR @Matt561



Description
Two related Activity-redesign bug fixes on one branch.
1. Stuck confirmation on back after a transaction (TMCU-1001).
After submitting a full-screen confirmation (send, Earn pooled-staking, or stablecoin lending), the app redirects to the Activity screen. With the Money-account feature enabled, Activity is registered as a root-level screen, so the redirect pushed it on top of the still-mounted confirmation — whose approval had already been consumed (
deleteAfterResult). Pressing back returned to that consumed confirmation, which rendered an infinite loader/skeleton.The fix adds a shared
navigateToActivityAfterConfirmationhelper that replaces the confirmation's stack with Activity in a singleStackActions.replace, removing the stale confirmation from the back stack. It's wired into the shared transaction confirm hook (useTransactionConfirm), batch approvals (useConfirmActions), the Earn lending deposit/withdrawal views, and the legacy staking footer.Approach note : I first tried to make "back" return to the transaction build screen (amount / recipient / input). On a native-stack that means removing the nested confirmation while pushing a root-level Activity — two screen changes that react-native-screens animates at the same time, producing a double-navigation on the way in and a flashing half-finished pop on the way back. After several attempts to work around the animation, the reliable single-transition solution was to replace the confirmation's whole stack. As a result: send/staking → back returns to Wallet home; lending → back returns to the input screen (its input lives in a separate stack that survives the replace).
2. Missing token icon/amount on lending deposit rows (TMCU-1082).
Lending deposit Activity rows derived their token from the pool contract (
txParams.to) instead of the underlying deposited asset, so the row had no resolvable icon, symbol, or amount. The supplied token is now resolved from simulation data / the outgoing Transfer log (falling back to the pool address), and lending token metadata is enriched from the tokens API; the row avatar uses the resolved token.Changelog
CHANGELOG entry: Fixed the Activity screen back button returning to a stuck confirmation screen after a transaction, and fixed the missing token icon and amount on Earn lending deposit rows.
Related issues
Fixes: TMCU-1001
Fixes: TMCU-1082
Manual testing steps
Also covered by automated tests: real-navigator integration tests for all three navigation flows (
navigateToActivityAfterConfirmation.test.tsx), the redirect call sites, and the lending row/adapter changes (ActivityListItemRow,local-transaction).Screenshots/Recordings
Staking Before
stake_before.mov
Staking After
stake_after.mov
NFT Send Before
nft_send_before.mov
NFT Send After
nft_send_after.mov
Native Send Before
native_send_before.mov
Native Send After
native_send_after.mov
Send Before
send_before.mov
Send After
send_after.mov
Lending Icon Fix Before
lending_before.mov
Lending Icon Fix After
lending_after.mov
Before
~After
~Pre-merge author checklist
Performance checks (if applicable)
Pre-merge reviewer checklist
Note
Medium Risk
Navigation stack replacement affects multiple confirmation flows; lending adapter heuristics could mis-identify tokens on unusual receipt shapes, though fallbacks and tests cover main paths.
Overview
Fixes two Activity-redesign issues: post-transaction back navigation and lending deposit row/details display.
Post-tx navigation: Adds
navigateToActivityAfterConfirmation, which uses rootStackActions.replacefor Activity whenTRANSACTIONS_VIEWis on the root stack (Money-account on), instead of pushing Activity on top of a consumed confirmation. Falls back to plainnavigateotherwise. Wired throughuseTransactionConfirm,useConfirmActions, Earn lending confirm views, and staking footer.Lending token display:
local-transactionnow resolves lending depositsourceTokenfrom simulation balance decreases or user outgoing ERC-20 transfers (pool or aToken recipient), nottxParams.to. NewenrichTokenFromApifills symbol/decimals from the tokens API for lending rows (useActivityListItemRowContent), avatars, andSwapDetailsamount headers when adapters only supply atomic amounts +assetId.Reviewed by Cursor Bugbot for commit 212f871. Bugbot is set up for automated code reviews on this repo. Configure here.