-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Refactor Workspace Invite Member page #5726
Conversation
Heads up: There is an issue with this PR where members are being removed from Onyx as soon as they are added. I am not able to determine the cause of it. Its driving me nuts. Help needed. I pushed it for review to get more Eyes |
@@ -248,7 +248,7 @@ function invite(logins, welcomeNote, policyID) { | |||
policy.alertMessage = ''; | |||
|
|||
// Optimistically add the user to the policy | |||
Onyx.set(key, policy); | |||
Onyx.merge(key, policy); |
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 had to make this change otherwise, newly added members were being removed as soon as they were added to Onyx.
I am not sure how to debug the Onyx but I tried debugging the code and somehow internal Keychanged handler is getting old value in the next tick.
@Julesssss Ready for review. |
@parasharrajat
1.New.Expensify.-.Google.Chrome.2021-10-15.17-49-48.mp4This is an issue with how When we always use There's no single way to fix the race condition at the root
I think you've found the solution for the problem at hand - use For the future we can consider exposing only one way for updating Onyx values so to not cause race conditions and make people wonder should they use |
Another take on this problem is why do we store the Do we need the error to be persisted so we display it again later, when the user is back at this page or if they restart the app? Seeing a code like this reviews that we're not interested in a persisted value and we're using persistent storage for something temporary componentDidMount() {
this.clearErrors();
} If we're clearing errors on mount it's obvious we don't care about errors that happened in the past. Then why use persistent storage at all. If Onyx was the only way we dealt with state then I agree that we should always use that, but many components have local state, and this one does too, and if we're not interested in persisted errors, we should just skip persisting them |
I agree with @kidroca's point here. But I followed the approach which was already being used in this component and other pages. So I won't argue the approach. Open to suggestions, if any? |
Great Explanation. @kidroca. Thanks for investing time in this. I think we are good for this PR as merge and set have no difference in this scenario. |
Ah, so it was My guess is that it's because you have two different 'keywords': |
Awaiting approval from Design. |
@shawnborton Let me know if #5726 (comment) looks good. Please. |
Looks good, but let's remove the styling and icon from the privacy policy link and just make it blue. Thoughts on that? Or actually crazy idea, can we just put the privacy policy link after the list of people? This way it's a bit more hidden by default? |
Yup. Will look better and I think Icon can stay as it is informative.
Where exactly? you mean at the end of the user list shown only when scrolled. I doubt that. |
What makes you say you doubt it? We can always ask our legal team for advice here too. |
If the user has about 30 users. He will likely scroll to the end. And this is complex to do ATM. 😄 . |
Got it, that's fair feedback. In the very least, let's see it in just blue and perhaps right-aligned as well. Thanks! |
Nice, can we see it without the icon as well? |
Okay sweet, thanks for sharing! I think now that I see it, left-aligned might look better. Then I think it's all good on my end. Thanks Rajat! |
No icon? @shawnborton |
Correct, blue and no icon. |
Changes are done as requested. Ready for merge. |
Nice, I think you just need to update screenshots and then we're good there. |
❗ Please, do not use Github auto-linking keywords such as these: close, closes, closed, fix, fixes, fixed, resolve, resolves or resolved. For more details, see the Contributing Guidelines, specifically Submit your pull request for a final review 📖. |
2 similar comments
❗ Please, do not use Github auto-linking keywords such as these: close, closes, closed, fix, fixes, fixed, resolve, resolves or resolved. For more details, see the Contributing Guidelines, specifically Submit your pull request for a final review 📖. |
❗ Please, do not use Github auto-linking keywords such as these: close, closes, closed, fix, fixes, fixed, resolve, resolves or resolved. For more details, see the Contributing Guidelines, specifically Submit your pull request for a final review 📖. |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by @Julesssss in version: 1.1.8-10 🚀
|
🚀 Deployed to production by @roryabraham in version: 1.1.10-2 🚀
|
Details
Known issues
Fixed Issues
$ #4775
$ #5723
Tests | QA Steps
Tested On
Screenshots
Web | Desktop
Mobile Web
iOS
Android