-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix: Cannot remove RBR when invite an invalid member to workspace #23157
Merged
NikkiWines
merged 8 commits into
Expensify:main
from
tienifr:fix/22359-can-not-remove-rbr-invite-workspace-member
Jul 26, 2023
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a5a6b64
fix: cannot remove rbr when invite an invalid workspace member
tienifr 304a5e6
exclude current account id
tienifr 012b2aa
refactor using chain
tienifr 9d734b9
dummy account ID length
tienifr ca996a6
isDummy account
tienifr 78f8ba1
change isDummy to isOptimisticData
tienifr b3998dc
remove isOptimisticData
tienifr 9eba1dd
remove isOptimisticData
tienifr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
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.
@tienifr, why do we delete it only if accountID.length >= 15?
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.
It's a "dummy"
accountID
, generated locally byApp/src/libs/UserUtils.js
Line 214 in d3a13d6
In other words, they're invalid account that we've just invited. Otherwise, even after dismissing the error, the invalid accounts still appear in the suggested invite list.
I don't know if there's already a function for checking "dummy"
accountID
so I manually check based onlength
.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.
What would happen if we deleted accountID here no matter if it's the dummy one or not?
We will remove a valid accountID from PERSONAL_DETAILS_LIST, but will it be there after a refresh?
I'm basically wondering what would happen if in the future we had accountID's longer than 15
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.
How about adding
isDummyAccount
(or sth else) into these account personal details when we create theoptimisticPersonalDetails
?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.
Yeah, that would be better, let's do that instead
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.
I've updated that. Please check again.
dummy-account-compressed.mov
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.
Now that I think about it more, we shouldn't delete the account info when we dismiss an error. The error doesn't necessarily mean "This account is invalid", just that there was some kind of a problem when inviting the user.
We might want to add the ability to "clear" recent users if this is considered a problem, but I don't think this should be a part of this PR
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.
So that we're good with showing the invalid accounts in the invite suggestion list; and will implement another feature to clear that later?
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.
Asking in https://expensify.slack.com/archives/C01GTK53T8Q/p1690239157923059
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.
Well that didn't get a lot of traction 😄
But still, it's 2 vs 1 in favor of removing the user, so let's leave it as it is, no changes needed, I'll finish the checklist shortly