-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Implement the proper handling of restrictions to leave or be removed from a workspace in NewDot #56750
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
Comments
Current assignee @trjExpensify is eligible for the Bug assigner, not assigning anyone new. |
@huult you'll need to comment for me to co-assign you as well. |
@trjExpensify Please assign this to me, thanks. |
@trjExpensify for any copy edits, would it be best for me to just edit them right where you posted them above? |
Yeah, go for it. I can check the edit diff if needs be. |
Updated! One question - I noticed in this one we give instructions on where to update (last line):
Should we do the same in others, like the "technical contact" or no? |
Thanks for consolidating this, Tom. Looks great! 🙌 For the case Warn - can be removed We throw and ask user to manually change technical contact as per this code https://github.com/Expensify/Web-Expensify/blob/5736bed558d4ec9a1414c481435e5cc5f66ce6ff/lib/PolicyAPI.php#L946-L948 Are we automating that now? |
Also, we don't allow admins to leave We have this access controls on leaving/removing https://github.com/Expensify/App?tab=readme-ov-file#workspace |
You can't change the technical contact in NewDot yet (and it's unclear if we'll ever carry it over), so I left the instruction out. I don't expect this one to throw much for a NewDot company as they likely won't change it away from the workspace owner as a result. That said, if they happen to do it over on OldDot, we'll update the technical contact to the workspace owner on leave/removal if they proceed. @MonilBhavsar same reason for now automating updating the technical contact to answer that question.
Yeah, that was a mistake with whoever/whenever this was added to NewDot. On OldDot a non-owner admin has historically been able to leave a workspace -- providing there aren't other restrictions in play with that user. ![]() |
Hi! So what are the next steps here? We should probably figure out what needs to get changed on the front end, what needs to get changed on the backend, and then split up that work accordingly... Can we also confirm whether we want to move forward with the (reverted) |
Sounds good. So we might want to update server to not throw when removing technical contact
It was discussed here. Should we bring this discussion back again? |
That discussion was about permission for leaving different types of chats, not the actual workspace. |
What are the next steps here, and who's taking that on? |
It was in a similar thread but hard to find in archived channel. The conclusion was noted in this SO and I think we're doing right as per it https://stackoverflowteams.com/c/expensify/questions/18263/18264 |
@huult @shubham1206agra do you please mind opening a draft PR. I am happy to help with backend changes. Would be good to test backend against frontend changes |
@MonilBhavsar Sure! I'll open a draft PR shortly. |
How's it going here? |
@MonilBhavsar I was sick for two days. I'll test it this weekend—thank you! |
👋 Catching up after OoO! @huult what's the latest on your PR? Let's get this squared away!
@MonilBhavsar on this one for the DC restriction to leave. Interesting, so the way OldDot handles it is just by hiding the front-end button to "leave" the workspace if there's a domain control restriction, not actually restricting it from the backend. Meaning, if we "do nothing" for now in NewDot they will be able to actually leave the workspace properly. Admittedly, that's better than it "appearing" like they left but didn't, albeit a loophole. I appreciate your point that domain settings haven't been added to onyx yet, and it might be jumping the gun to add this one, as domain control is on the roadmap for Q3 and not yet fleshed out. I'm a little hesitant about a platform specific loophole though, but it's not a super widely used feature, so I guess I'm probably okay with leaving it for the time being. CC: @JmillsExpensify for a second opinion. |
@huult any updates to share? |
@MonilBhavsar Sorry for the delay. I will complete and send the final feedback to you by the end of Wednesday |
Thanks |
Could you kindly share a video demonstrating the steps above? Thank you! |
Screen.Recording.2025-04-25.at.4.25.29.PM.mov |
thank you, I'm checking! |
Old dot ![]() @MonilBhavsar What role do we use to identify the member who is the technical contact on newDot? |
We can't figure out technical contact from the role. Can you share the exact problem? Are you trying to figure out technical contact of policy on newDot? |
Got it. Let me check |
@MonilBhavsar Got it. I’ll do it today. Thanks! |
I'm finished updating the technical contact. I'm testing it now! |
@huult any new update? |
I will update the new code and maunal tests tonight and tomorrow. |
Thanks! |
Looks like personal policy from |
thanks |
@MonilBhavsar I was able to get the technicalContact and update the code. Continuing testing, thanks. |
I'm testing the PR now. |
Thanks for the updates! |
@MonilBhavsar Can we create an Onyx key in BE where we can detect if any error happens when leaving workspace / removing someone from workspace? It will help us implement |
@MonilBhavsar Could you check @shubham1206agra 's comment? |
Could you please explain why we need that additional key, and if we use similar pattern elsewhere in the App? |
@MonilBhavsar We need this key to determine which error happened when removing/leaving the workspace, since we can't know this before the response from BE. Also, we generally avoid side effects in API. Not sure about similar patterns |
Uh oh!
There was an error while loading. Please reload this page.
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
I'm consolidating #43508 and #55462 to get a handle on this afresh because it's a bit of a mess. Assigning everyone involved to clean it up.
Version Number:
Reproducible in staging?: Y
Reproducible in production?:
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by:
Slack conversation (hyperlinked to channel name):
Action Performed:
Leaving a workspace
Removing someone from a workspace
Expected Result:
Can leave and can be removed from the workspace:
All of these roles have the power to leave or be removed from the workspace if there aren't any other restrictions in play.
Can't leave the workspace:
These are the restrictions on being able to leave the workspace.
processing
report waiting on them to approveCan't be removed from the workspace:
These are the restrictions on being able to be removed from the workspace.
Cases and Confirmation Modal Copy
CC: @jamesdeanexpensify if you have any feedback on this copy.
Leave
.Leave
.Leave
.Leave
Remove from workspace
.processing
report to action on:processing
report to action on:Leave
Remove from workspace
.Leave
Leave
Remove from workspace
.Remove from workspace
.Do not show the
Leave
button to:Do not show the
Remove from workspace
button on:Actual Result:
A lot of inconsistencies where the frontend doesn't match the backend, for example in this recording below. This is an approver who has an outstanding processing report submitted to them. As per the BE logic for leaving a workspace, they shouldn't be allowed to leave the workspace. In NewDot we're showing them a Leave button, they click it and it appears as though they've left the workspace successfully, but in reality they haven't.
2025-02-12_08-48-41.mp4
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Alert modal examples.
Warn - can be removed.
Warn - can't be removed.
Warn - can leave.
Warn - can't leave.
View all open jobs on GitHub
Issue Owner
Current Issue Owner: @MonilBhavsarThe text was updated successfully, but these errors were encountered: