hotfix: positions query#516
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughPR adds loading UI feedback for feed metrics calculation, replaces inline placeholder with persistent toast notification, refactors position market identification to use chain-aware keys with blacklist filtering and missing metadata hydration, and documents related regression constraint. ChangesFeed Detail Loading State
Position Market Metadata Hydration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/hooks/useUserPositions.ts (1)
258-264: ⚡ Quick winFailed hydrations are silent.
When
fetchMonarchMarketrejects or returns null for a user-discovered market, that position quietly disappears at the!marketgate (line 305). Aconsole.warnwith the chainId/marketUniqueKey would make this regression class observable in the wild.Optional log nudge
for (const result of missingMarketResults) { if (result.status !== 'fulfilled' || !result.value) { + if (result.status === 'rejected') { + console.warn('[Positions] Failed to hydrate user-owned market', result.reason); + } continue; }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/hooks/useUserPositions.ts` around lines 258 - 264, When iterating missingMarketResults in useUserPositions, failed or null fetches are currently ignored; update the loop that handles missingMarketResults (the block that checks result.status !== 'fulfilled' || !result.value) to log a warning via console.warn including the chain id and market unique key so failures are observable. Use the same identity fields used in getMarketIdentityKey (result.value?.morphoBlue?.chain?.id and result.value?.uniqueKey) and include the promise result status and any error information available, but still continue to skip adding to marketDataMap.set for failed/null results.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/hooks/useUserPositions.ts`:
- Around line 258-264: When iterating missingMarketResults in useUserPositions,
failed or null fetches are currently ignored; update the loop that handles
missingMarketResults (the block that checks result.status !== 'fulfilled' ||
!result.value) to log a warning via console.warn including the chain id and
market unique key so failures are observable. Use the same identity fields used
in getMarketIdentityKey (result.value?.morphoBlue?.chain?.id and
result.value?.uniqueKey) and include the promise result status and any error
information available, but still continue to skip adding to marketDataMap.set
for failed/null results.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: fad88bf0-1645-41c3-8d25-5ad9aac3ded0
📒 Files selected for processing (4)
AGENTS.mdsrc/features/feed-detail/components/feed-sections.tsxsrc/features/feed-detail/feed-view.tsxsrc/hooks/useUserPositions.ts
Summary by CodeRabbit
Release Notes
New Features
Improvements