Skip to content

fix: user lists not refreshing after add, remove or role change - #9802

Merged
nishantmonu51 merged 1 commit into
mainfrom
nishantmonu51/fix-org-user-list-not-refreshing
Aug 11, 2026
Merged

fix: user lists not refreshing after add, remove or role change#9802
nishantmonu51 merged 1 commit into
mainfrom
nishantmonu51/fix-org-user-list-not-refreshing

Conversation

@nishantmonu51

Copy link
Copy Markdown
Collaborator

The org users, invites and groups tables read through Orval's infinite queries, which are cached under an "infinite"-prefixed key (["infinite", "/v1/orgs/{org}/members", …]). Every mutation invalidated only the plain key (["/v1/orgs/{org}/members", …]). TanStack matches keys by prefix, so the leading "infinite" element made the match fail and nothing refetched — the tables only updated on a page reload.

  • Added invalidateOrgMemberUsers, invalidateOrgInvites and invalidateOrgUsergroups to user-management/utils.ts, each invalidating both key variants, and routed all 12 call sites through them: the add/remove/role-change dialogs, the groups tab, and the project-side invite forms.
  • The groups tab had the same defect: #9793 moved that table to an infinite query but left the invalidations on the plain key.
  • Dropped type: "all" from two project-side call sites. It is TanStack's default filter value, so it was a no-op.
  • utils.spec.ts covers all three helpers: both key variants get invalidated, and another organization's cache does not.

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

The org users, invites and groups tables read through Orval's infinite
queries, which are cached under an "infinite"-prefixed key. Every mutation
invalidated only the plain key, and since TanStack matches keys by prefix,
the invalidation never matched and nothing refetched: the tables only
updated on a page reload.

Add invalidateOrgMemberUsers, invalidateOrgInvites and
invalidateOrgUsergroups, each invalidating both key variants, and route
every call site through them.
@nishantmonu51
nishantmonu51 merged commit b825755 into main Aug 11, 2026
15 checks passed
@nishantmonu51
nishantmonu51 deleted the nishantmonu51/fix-org-user-list-not-refreshing branch August 11, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants