-
Notifications
You must be signed in to change notification settings - Fork 74
Cache invalidations and fixes #3108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughMigrates many direct provider/RPC calls to React Query using Changes
Sequence Diagram(s)sequenceDiagram
participant UI as App UI
participant QC as QueryClient (getQueryClient)
participant SDK as `@ecency/sdk`
participant API as Remote API
UI->>QC: fetchQuery(getNotificationsUnreadCountQueryOptions(username, token))
QC->>SDK: build/normalize request
SDK->>API: HTTP request (notifications/unread)
API-->>SDK: unread count response
SDK-->>QC: normalized result
QC-->>UI: resolved unread count
UI->>UI: update badge/state
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/containers/profileContainer.tsx (1)
318-344:⚠️ Potential issue | 🔴 CriticalAdd
pinCodeto destructuring in_fetchProfilemethod.
At line 319,pinCodeis referenced (line 336) without being destructured from props, causing a ReferenceError for non-own profiles. Other methods in this component correctly destructure it.🛠️ Suggested fix
- const { currentAccount } = this.props; + const { currentAccount, pinCode } = this.props;
🧹 Nitpick comments (1)
src/components/organisms/quickProfileModal/children/quickProfileContent.tsx (1)
207-217: Consider removing the Alert on error to avoid duplicate notifications.The mutation hooks (
useAddFavouriteMutationanduseDeleteFavouriteMutation) already dispatch a fail toast in their error callbacks. Showing an additionalAlert.alerthere results in users seeing both a toast and a modal alert for the same error.If the detailed error message is valuable, consider either:
- Removing this Alert and relying on the mutation hook's toast, or
- Modifying the mutation hooks to not dispatch a toast on error, allowing components to handle error display with more context
Option 1: Remove the redundant Alert
onError: (error: any) => { // Error toast is already dispatched by the mutation hook console.warn('Failed to perform favorite action', error); setIsLoading(false); - Alert.alert( - intl.formatMessage({ - id: 'alert.fail', - }), - error.message || error.toString(), - ); },
Summary by CodeRabbit
New Features
Bug Fixes
Performance Improvements
Chores