feat: add mark as bot, and reload page after (CM-908)#3786
Closed
feat: add mark as bot, and reload page after (CM-908)#3786
Conversation
frontend/src/modules/member/components/member-dropdown-content.vue
Outdated
Show resolved
Hide resolved
joanagmaia
reviewed
Jan 28, 2026
Comment on lines
118
to
136
| 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); |
Contributor
There was a problem hiding this comment.
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?
frontend/src/modules/member/components/list/member-list-toolbar.vue
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.