Skip to content

fix: guard borrowInfo access in reserve overview and market list#2941

Open
mgrabina wants to merge 2 commits intomainfrom
fix/sentry-cs-reserve-overview-guard
Open

fix: guard borrowInfo access in reserve overview and market list#2941
mgrabina wants to merge 2 commits intomainfrom
fix/sentry-cs-reserve-overview-guard

Conversation

@mgrabina
Copy link
Copy Markdown
Contributor

@mgrabina mgrabina commented Apr 15, 2026

Summary

  • Remove unsafe type casts (as ReserveWithId, as ComputedReserveData) in reserve-overview page and add a loading guard when SDK data hasn't loaded yet
  • Add optional chaining for borrowInfo.total.amount.value access in MarketAssetsListItem and MarketAssetsListMobileItem where the && chain doesn't short-circuit properly

Fixes AAVE-V3-CS (593 users, 673 events).

Test plan

  • Load the markets page and verify borrow info columns render correctly
  • Navigate to a reserve overview page and verify it loads without errors
  • Check that reserves with disabled borrowing still show the "Disabled" label

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
interface Ready Ready Preview, Comment Apr 16, 2026 1:49pm

Request Review

@github-actions
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

📦 Next.js Bundle Analysis for aave-ui

This analysis was generated by the Next.js Bundle Analysis action. 🤖

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 1.15 MB (🟢 -624 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Sixteen Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/ 67.05 KB (🟡 +1.57 KB) 1.22 MB
/404 2.87 KB (🟡 +3 B) 1.15 MB
/500 3.2 KB (🟡 +5 B) 1.15 MB
/bridge 29.03 KB (🟡 +3 B) 1.18 MB
/dashboard 56.95 KB (🟡 +1.65 KB) 1.21 MB
/faucet 15.21 KB (🟢 -3 B) 1.17 MB
/governance 81.2 KB (🟡 +2.71 KB) 1.23 MB
/governance/ipfs-preview 102.04 KB (🟡 +72 B) 1.25 MB
/governance/v3/proposal 125.53 KB (🟡 +2.96 KB) 1.27 MB
/history 36.11 KB (🟢 -40 B) 1.19 MB
/markets 39.26 KB (🟢 -1.05 KB) 1.19 MB
/reserve-overview 26.85 KB (🟡 +2.75 KB) 1.18 MB
/safety-module 32.15 KB (🟡 +2.47 KB) 1.18 MB
/sgho 89.97 KB (🟡 +1.88 KB) 1.24 MB
/staking 33.7 KB (🟢 -81 B) 1.18 MB
/v3-migration 36.68 KB (-3 B) 1.19 MB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

…ding

The .find() call returns undefined when SDK data is still loading, but
an unsafe cast hid this from TypeScript. Remove the as-casts and add a
guard to skip rendering the reserve configuration until data is available.
This matches the pattern already used by ReserveTopDetailsWrapper.
@mgrabina mgrabina force-pushed the fix/sentry-cs-reserve-overview-guard branch from 835eb72 to c05badb Compare April 16, 2026 13:46
@mgrabina mgrabina changed the title fix: guard reserve-overview page against undefined reserve during loading fix: guard borrowInfo access in reserve overview and market list Apr 16, 2026
@github-actions
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

📦 Next.js Bundle Analysis for aave-ui

This analysis was generated by the Next.js Bundle Analysis action. 🤖

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 1.15 MB (🟢 -218 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Sixteen Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/ 67.06 KB (🟡 +1.58 KB) 1.22 MB
/404 2.87 KB (🟡 +3 B) 1.15 MB
/500 3.2 KB (🟡 +5 B) 1.15 MB
/bridge 29.03 KB (🟡 +3 B) 1.18 MB
/dashboard 56.96 KB (🟡 +1.66 KB) 1.21 MB
/faucet 15.21 KB (🟢 -3 B) 1.17 MB
/governance 81.22 KB (🟡 +2.74 KB) 1.23 MB
/governance/ipfs-preview 102.04 KB (🟡 +72 B) 1.25 MB
/governance/v3/proposal 125.55 KB (🟡 +2.98 KB) 1.27 MB
/history 36.11 KB (🟢 -40 B) 1.19 MB
/markets 39.27 KB (🟢 -1.05 KB) 1.19 MB
/reserve-overview 26.85 KB (🟡 +2.75 KB) 1.18 MB
/safety-module 32.15 KB (🟡 +2.47 KB) 1.18 MB
/sgho 89.98 KB (🟡 +1.89 KB) 1.24 MB
/staking 33.7 KB (🟢 -80 B) 1.18 MB
/v3-migration 36.68 KB (-3 B) 1.19 MB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

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.

1 participant