-
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
base: master
Are you sure you want to change the base?
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.
organization { | ||
id | ||
name | ||
} |
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.
-1 organization
is currently unused. It also might not be able to resolve all fields for kicked out users as they're not a member anymore. As we need this for the kicked out users for their updates, add an organizationId
field.
const removedOrgMembers = payload.getLinkedRecords('removedOrgMembers') | ||
const orgId = payload.getLinkedRecord('organization').getValue('id') | ||
|
||
if (users.some((user) => user.getValue('id') === viewerId)) { |
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.
-1 if we handle refreshing the auth token correctly, this update should not reach the kicked out users. Instead all the updates for the kicked should be done in the notification subscription.
team { | ||
id | ||
name | ||
activeMeetings { |
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.
-1 This will be empty for the kicked out use because they are not a team member anymore:
parabol/packages/server/graphql/types/Team.ts
Line 218 in 73c64d6
if (!isTeamMember(authToken, teamId)) return [] |
I think it would be better to have a flat kickOutNotifications
object with just constant fields and no nested objects.
const users = payload.getLinkedRecords('users') | ||
const {viewerId} = atmosphere | ||
|
||
if (users.some((user) => user.getValue('id') === viewerId)) { |
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.
-1 This should not reach the kicked out user anymore
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? |
Description
Following up #10675, this PR is the client-side mutation
Final checklist