Repository navigation
Conversation
…d behind a flag With NEXT_PUBLIC_ENABLE_BACKEND_POOL_READS=true, AppDataProvider builds the legacy reserves, eModes and user summary from the @aave/client market, userSupplies and userBorrows queries on markets the backend serves, and the UiPoolDataProvider and UiIncentiveDataProvider polls stop there. Claimable incentives keep their RPC reads in the claim modal and dashboard panel. After a tx the backend data is refetched once the backend indexes it. Off by default: the prod backend prices weETH 0.26% off the chain.
|
@codex review |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: af18d5e42d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const rpcUser = useExtendedUserSummariesAndIncentives(rpcMarkets)[0]; | ||
| const rpcReserves = usePoolsFormattedReserves(rpcMarkets)[0]; |
There was a problem hiding this comment.
Avoid re-enabling full RPC polling for claimable rewards
With backend pool reads enabled, the dashboard still polls the entire RPC data graph because DashboardTopPanel calls this hook unconditionally. useExtendedUserSummariesAndIncentives transitively subscribes to pool reserves, user reserves, reserve incentives, user incentives and eModes, and these hooks retain their 60-second polling intervals. Consequently, the dashboard adds the backend requests without eliminating the RPC reads this feature is intended to replace. Read only the incentive data needed for claims instead of constructing a complete RPC user summary; the dashboard's existing useEnhancedUserYield subscription also needs to use backend app data to avoid independently keeping the same polling graph active.
Useful? React with 👍 / 👎.
|
📦 Next.js Bundle Analysis for aave-uiThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
…led read The markets query polls and refetches on focus only with the flag on, with one retry so an outage falls back to RPC quickly. A failed getEModes read or eMode-id fallback now sends the market back to RPC instead of loading forever.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4671b0acc2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| failed: | ||
| (positionsQuery.isError && !positions) || | ||
| (!!eModesQuery?.isError && !eModesQuery.data) || |
There was a problem hiding this comment.
Fall back to RPC when backend refreshes fail
With backend reads enabled, an outage after the first successful fetch never activates the RPC fallback: React Query retains cached data on refetch errors, so positionsQuery.isError && !positions remains false. Errors from the market snapshot query are also not considered by servedByBackend in useAppDataProvider.tsx. Consequently, the provider continues serving stale balances, prices and health factors with loading cleared for the duration of the outage, even when RPC is healthy. Include refresh errors from both backend queries in the fallback decision rather than limiting fallback to errors without cached data.
Useful? React with 👍 / 👎.
|
📦 Next.js Bundle Analysis for aave-uiThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
React Query keeps cached data on refetch errors, so the fallback also has to trigger on errors with data, for both the market and the positions query.
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
📦 Next.js Bundle Analysis for aave-uiThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
…fetches A refetch of a query that never got data resets react-query's isPending and isError, so every pool invalidation dropped the RPC reads on forks and on any market whose backend read had failed, emptying reserves mid-transaction. Decide from the last settled fetch instead.
|
📦 Next.js Bundle Analysis for aave-uiThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
Context: AppDataProvider polls UiPoolDataProvider and UiIncentiveDataProvider every 60s per tab, though the backend market query has the same data.
Now: reserves, eModes and the user summary come from the backend on the markets it serves, and refetch once a tx is indexed. Claimable rewards and getEModes keep their RPC reads. Unserved markets, forks and any failed backend read fall back to RPC.
formatUserSummarywith unit indexes, so the HF and yield math stays as it is.Checked: field by field against RPC on 5 markets: 24/24 accounts match on the prod backend, and 12,286 reserve values differ only in token names and the weETH price drift. Locally: 3 requests a minute per tab, 0 while hidden.
Review in order:
sdkLegacyReserves.ts,sdkLegacyUser.tsuseBackendAppData.ts,useAppDataProvider.tsxrefreshPoolData.tsand call sitesPart of SDK-1126