fix(predict): fix query invalidation logic in usePredictToastRegistrations#27147
Conversation
|
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Tag Selection Rationale:
The change is medium risk because it modifies data refresh behavior that could affect user experience if positions/activity don't update correctly after claim transactions, but it's a targeted optimization that should improve performance by reducing unnecessary query invalidations. Performance Test Selection: |
|
✅ E2E Fixture Validation — Schema is up to date |
|



Description
Deposit and withdraw toast handlers were incorrectly invalidating positions and activity queries, causing unnecessary refetches. This change scopes those invalidations to only the
claimtype, where they are actually relevant. Balance and unrealized PnL queries remain invalidated for all types.Changelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Low-risk change limited to React Query cache invalidation; it only reduces unnecessary refetches after deposit/withdraw confirmations and should not affect transaction execution.
Overview
Fixes
usePredictToastRegistrationsquery invalidation so onconfirmedtransactions it always invalidatesbalanceandunrealizedPnL, but only invalidatespositionsandactivitywhen the transactiontypeisclaim.This prevents deposit/withdraw toast flows from triggering unnecessary
positions/activityrefetches while keeping claim-related data refresh behavior intact.Written by Cursor Bugbot for commit e157a2e. This will update automatically on new commits. Configure here.