Closed izarutskaya closed 1 year ago
Triggered auto assignment to @stephanieelliott (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Platforms
in OP are ✅)Web - Split bill RHN doesn't close after member has been removed from a workspace
On the report screen, we are showing a page not found view whenever a user does not have access to a policy but there is no business rule/condition in place to hide the Split bill RHN pages.
On NewRequestAmountPage
& MoneyRequestConfirmPage
page check if the policy access has been removed then close the RHN modal.
Here is the detailed flow:
const prevPolicyID = useRef(props.report.policyID);
prevPolicyID
value with the current one, if not equal then close the dialog. Ideally, the policy id will be undefined whenever a user is removed from the workspace. useEffect(() => {
if((prevPolicyID.current !== undefined && prevPolicyID.current !== props.report.policyID))
{
Navigation.dismissModal(reportID);
}
}, [props.report])
Apply the same changes on NewRequestAmountPage
page and yes it'll cover scenarios which means whenever user B is removed from a workspace
useEffect(() => {
if((prevPolicyID.current !== undefined && prevPolicyID.current !== report.policyID))
{
Navigation.dismissModal(reportID);
}
}, [report])
N/A
Split bill RHN doesn't close after member has been removed from a workspace
In NewRequestAmountPage we will dismiss modal when the user don't have permission to comment like this report
But with the announce room, when the user is removed from workspace the announce room will disappear totally and we don't have logic to dismiss modal in this case
In MoneyRequestConfirmPage, we also don't have logic to dismiss modal in above cases
In NewRequestAmountPage https://github.com/Expensify/App/blob/93bde2010f145bbb97c54c06922f0ea52453958c/src/pages/iou/steps/NewRequestAmountPage.js#L107-L112 Update the condition to dismiss modal when the report is deleted like this
useEffect(() => {
// Never dismiss if it is new request without reportID in route
if (!reportID) {
return
}
// dismiss modal if we request money/split bill in the invalid report
if ((report.reportID || report.isLoadingReportActions) && !ReportUtils.shouldDisableWriteActions(report)) {
return;
}
Navigation.dismissModal(reportID);
}, [report, reportID]);
In MoneyRequestConfirmPage, add the same logic like we did in NewRequestAmountPage
useEffect(() => {
// Never dismiss if it is new request without reportID in route
if (!reportID) {
return
}
// dismiss modal if we request money/split bill in the invalid report
if ((props.report.reportID || props.report.isLoadingReportActions) && !ReportUtils.shouldDisableWriteActions(props.report)) {
return;
}
Navigation.dismissModal(reportID);
}, [props.report, reportID]);
My proposal works well for 4 cases
Remove user when user is requesting money in amount step (at workspace room)
Remove user when user are requesting money in confirm step (at workspace room)
Remove user when user are splitting bill in amount step (at announce room)
Remove user when user are splitting bill in confirm step (at announce room)
https://github.com/Expensify/App/assets/141406735/a14c4a85-e5b2-436e-972c-f7c158ee3eb1
This is the expected behavior, you can split a bill without a shared workspace. We would expect the RHP to persist on user B's account until they manually closed it.
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
The split bill RHN should close as soon as account B has been removed from the workspace
Actual Result:
The RHN doesn't close on account B when account B has been removed from the workspace
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: v1.3.58-3
Reproducible in staging?: Y
Reproducible in production?: Y
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
Notes/Photos/Videos: Any additional supporting documentation
https://github.com/Expensify/App/assets/115492554/24dc72e2-c3c3-47ca-9725-4d8a77b3d74d
https://github.com/Expensify/App/assets/115492554/a043341e-0503-4e0f-8cc1-728a10b3f1f0
Expensify/Expensify Issue URL:
Issue reported by: @Nathan-Mulugeta
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1692706711050379
View all open jobs on GitHub