-
Notifications
You must be signed in to change notification settings - Fork 726
feat: add mark as bot, and reload page after (CM-908) #3786
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
Conversation
frontend/src/modules/member/components/member-dropdown-content.vue
Outdated
Show resolved
Hide resolved
| const invalidateMemberCache = async () => { | ||
| const invalidatePromises = [ | ||
| // Invalidate all members list queries | ||
| queryClient.invalidateQueries({ | ||
| queryKey: [TanstackKey.MEMBERS_LIST], | ||
| refetchType: 'all', | ||
| }), | ||
| // Reset all member-related queries to force complete refetch | ||
| queryClient.resetQueries({ | ||
| queryKey: [TanstackKey.MEMBERS_LIST], | ||
| }), | ||
| ]; | ||
|
|
||
| await Promise.all(invalidatePromises); | ||
|
|
||
| // Add delay to ensure React Query invalidation is fully processed | ||
| setTimeout(() => { | ||
| fetchMembers({ reload: true }); | ||
| }, 200); |
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.
This method seems a bit redundant. It's calling 3 different methods to achieve more a less the same thing.
For invalidateQueries:
- When a query is invalidated with invalidateQueries, two things happen:
- It is marked as stale. This stale state overrides any staleTime configurations being used in useQuery or related hooks
- If the query is currently being rendered via useQuery or related hooks, it will also be refetched in the background
For resetQueries:
- The resetQueries method can be used to reset queries in the cache to their initial state based on their query keys or any other functionally accessible property/state of the query.
For fetchMembers:
It will just trigger a new fetch of members with a full reload.
I would say that we can simplify by only having, either the invalidateQueries or the fetchMembers with full reload. Did you try this option?
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.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Fix Members List and Cache Invalidation Issues
Overview
This PR addresses several critical issues with the members list functionality, specifically around member attribute updates and cache synchronization.
Issues Fixed
1. Members Query Filters
2. Cache Invalidation
3. Bulk "Mark as Bot" Feature
Important Note - Backend API Limitation
Note
Adds bulk "Mark as bot" to the members list and makes attribute updates safe while ensuring the UI refreshes correctly.
member-list-toolbar.vue:markAsBot(with toggle copy/icon), event tracking, and handlerdoMarkAsBotMemberService.find(..., includeAllAttributes=true)and merge beforeupdateto prevent attribute lossinvalidateMemberCache) for bulk toolbar and per-member dropdown; triggersfetchMembers({ reload: true })MemberService.findand DALqueryMembersAdvanced/executeQuerywithincludeAllAttributes; default returns minimal attributes, optional flag includes additional fields (e.g.,bio,company,websiteUrl)savedFilterBodyandorderBy, and improves query keys/invalidation when project group or filters changeWritten by Cursor Bugbot for commit 7a3d524. This will update automatically on new commits. Configure here.