-
Notifications
You must be signed in to change notification settings - Fork 336
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
feat: add client-side RemoveMultipleOrgUsersMutation #10805
Conversation
Co-authored-by: parabol-release-bot[bot] <150284312+parabol-release-bot[bot]@users.noreply.github.com>
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.
Did not test
packages/server/graphql/public/mutations/removeMultipleOrgUsers.ts
Outdated
Show resolved
Hide resolved
packages/server/graphql/public/mutations/removeMultipleOrgUsers.ts
Outdated
Show resolved
Hide resolved
packages/server/graphql/public/mutations/removeMultipleOrgUsers.ts
Outdated
Show resolved
Hide resolved
packages/server/graphql/public/mutations/removeMultipleOrgUsers.ts
Outdated
Show resolved
Hide resolved
packages/server/graphql/public/mutations/removeMultipleOrgUsers.ts
Outdated
Show resolved
Hide resolved
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.
Wow, that's quite convoluted. From reviewing this I get the impression that removeOrgUser
should be half-broken currently.
packages/server/graphql/public/mutations/removeMultipleOrgUsers.ts
Outdated
Show resolved
Hide resolved
Hey @Dschoordsch , thanks so much for taking time to review this. I agree it's quite complicated and it also makes me wonder if
Sounds good? |
@Dschoordsch now with regards to this PR specifically, I have a doubt on this statement you made:
The unsubscribe operation comes with 1 second delay. In my test, the removed users would still get all the updates from the team/org they were removed from? |
Yes, you're right. I wasn't aware of that delay. I also discussed this with Matt. The cleanest solution would be to make the remove object flat with just ids as I had described. While resolving the removed User in this scenario works, it would fail if some User fields were requested where we check additional permissions. The issue is that it's not clear for future developers in this context, that that might happen. So it's safer to make the switch. |
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.
Looks good. When testing though, I get the following warning for the removed Users (tested in Chrome and Firefox):
Warning: Cannot update a component (`TeamContainer`) while rendering a different component (`TeamDashMainRoot`). To locate the bad setState() call inside `TeamDashMainRoot`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render
TeamDashMainRoot@webpack-internal:///./packages/client/modules/teamDashboard/components/TeamDashMainRoot.tsx:31:67
Route@webpack://parabol-action/./node_modules/react-router/esm/react-router.js?:448:29
Switch@webpack://parabol-action/./node_modules/react-router/esm/react-router.js?:650:29
Suspense
div
Styled(div)
Team@webpack-internal:///./packages/client/modules/teamDashboard/components/Team/Team.tsx:89:67
ErrorBoundary@webpack-internal:///./packages/client/components/ErrorBoundary.tsx:55:5
ErrorBoundaryFn@webpack-internal:///./packages/client/components/ErrorBoundary.tsx:131:86
TeamContainer@webpack-internal:///./packages/client/modules/teamDashboard/containers/Team/TeamContainer.tsx:40:7
Suspense
TeamRoot@webpack-internal:///./packages/client/modules/teamDashboard/components/TeamRoot.tsx:28:67
Route@webpack://parabol-action/./node_modules/react-router/esm/react-router.js?:448:29
Switch@webpack://parabol-action/./node_modules/react-router/esm/react-router.js?:650:29
main
Styled(main)
div
Styled(div)
div
Styled(div)
Dashboard@webpack-internal:///./packages/client/components/Dashboard.tsx:133:7
Suspense
DashboardRoot@webpack-internal:///./packages/client/components/DashboardRoot.tsx:35:69
C@webpack://parabol-action/./node_modules/react-router/esm/react-router.js?:705:31
Route@webpack://parabol-action/./node_modules/react-router/esm/react-router.js?:448:29
Switch@webpack://parabol-action/./node_modules/react-router/esm/react-router.js?:650:29
PrivateRoutes@webpack-internal:///./packages/client/components/PrivateRoutes.tsx:64:66
Route@webpack://parabol-action/./node_modules/react-router/esm/react-router.js?:448:29
Switch@webpack://parabol-action/./node_modules/react-router/esm/react-router.js?:650:29
div
Suspense
ErrorBoundary@webpack-internal:///./packages/client/components/ErrorBoundary.tsx:55:5
ErrorBoundaryFn@webpack-internal:///./packages/client/components/ErrorBoundary.tsx:131:86
_c21<@webpack-internal:///./packages/client/components/Action/Action.tsx:59:72
Provider@webpack-internal:///./node_modules/@radix-ui/react-context/dist/index.mjs:34:47
TooltipProvider@webpack-internal:///./packages/client/node_modules/@radix-ui/react-tooltip/dist/index.mjs:64:7
Router@webpack://parabol-action/./node_modules/react-router/esm/react-router.js?:79:30
BrowserRouter@webpack://parabol-action/./node_modules/react-router-dom/esm/react-router-dom.js?:57:35
RelayEnvironmentProvider@webpack://parabol-action/./node_modules/react-relay/lib/relay-hooks/RelayEnvironmentProvider.js?:7:18
AtmosphereProvider@webpack-internal:///./packages/client/components/AtmosphereProvider/AtmosphereProvider.tsx:21:5
Root
Can you take a look?
…out updating during render
Description
Following up #10675, this PR is the client-side mutation
Final checklist