Open lanitochka17 opened 2 weeks ago
Triggered auto assignment to @laurenreidexpensify (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
@laurenreidexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
Workspace switcher is switched to Expensify when creating a new send invoice.
When we complete the send invoice, it will call dismissModal
.
https://github.com/Expensify/App/blob/da2cd90b594b92be06de29942e8d4f47a3f69c25/src/libs/actions/IOU.ts#L3379
dismissModal
will call dismissModalWithReport
if there is a reportID from dismissModal
and decide whether to switch to the "Expensify" (all workspace).
https://github.com/Expensify/App/blob/da2cd90b594b92be06de29942e8d4f47a3f69c25/src/libs/Navigation/dismissModalWithReport.ts#L51
In doesReportBelongToWorkspace
, it will compare the report policyID
with the workspace policyID
, but if policyID
isn't available, it will compare the participants.
https://github.com/Expensify/App/blob/da2cd90b594b92be06de29942e8d4f47a3f69c25/src/libs/ReportUtils.ts#L1048
However, when we complete the send invoice, we are creating a new report and the report data is not available yet (not merged to the onyx yet). So, doesReportBelongToWorkspace
will always return false.
Replace Navigation.dismissModal
with Navigation.dismissModalWithReport
.
https://github.com/Expensify/App/blob/da2cd90b594b92be06de29942e8d4f47a3f69c25/src/libs/actions/IOU.ts#L3379
Then, we pass the invoice room report instead of the ID. We need to return the report object from getSendInvoiceInformation
if it's happening on other places too, then we can apply the same fix
Workspace switcher is reset to "Expensify" when sending invoice to the same WS
The sendInvoice
function calls for the Navigation.dismissModal
after the API call.
Within dismissModal
, the function originalDismissModalWithReport
will keep the correct workspace on the workspace switchef if shouldOpenAllWorkspace
is false
The issue here is that shouldOpenAllWorkspace
is turning TRUE, due to doesReportBelongToWorkspace
not turning the currect value.
We need to fix doesReportBelongToWorkspace
We can add another check, if policyID
exist, then it's from a policy and we need to keep the workspace switcher.
if (policyID && report?.policyID !== CONST.POLICY.ID_FAKE) {
return true;
}
return (
isConciergeChatReport(report) ||
(report?.policyID === CONST.POLICY.ID_FAKE || !report?.policyID ? hasParticipantInArray(report, policyMemberAccountIDs) : report?.policyID === policyID)
);
if policyID
exist, then we check if report?.policyID !== CONST.POLICY.ID_FAKE
, if so, the function turns true
as per the comment on the function
This is created to check if it's not a DM. My suggestion tested without regression
POC:
https://github.com/Expensify/App/assets/12425932/19a65f86-dcb6-44f9-a884-b900a38688bf
@laurenreidexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Job added to Upwork: https://www.upwork.com/jobs/~01038e8ff26d237540
Triggered auto assignment to Contributor-plus team member for initial proposal review - @allroundexperts (External
)
@allroundexperts, @laurenreidexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!
@allroundexperts bump for review pls
๐ฃ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? ๐ธ
Checking today
Triggered auto assignment to @rlinoz, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
@allroundexperts I tested the selected [proposa](https://github.com/Expensify/App/issues/41575#issuecomment-2093129242)
l and it's not working.
@bernhardoj can you pls share a test branch? I may tested with some wrong details!
@dragnoir Did you do the following?
Then, we pass the invoice room report instead of the ID. We need to return the report object from getSendInvoiceInformation
@dragnoir Did you do the following?
Yes, I did, does it work for you?
You can test it here
@allroundexperts the updates from @bernhardoj works well. Sorry about that and thank you @bernhardoj
๐ฃ @bernhardoj ๐ An offer has been automatically sent to your Upwork account for the Contributor role ๐ Thanks for contributing to the Expensify app!
Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review ๐งโ๐ป Keep in mind: Code of Conduct | Contributing ๐
PR is ready
cc: @allroundexperts
If you havenโt already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 1.4.70-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
Workspace switcher should remain unchanged when sending the invoice to the same workspace
Actual Result:
Workspace switcher is reset to "Expensify" when sending the invoice to the same workspace
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
https://github.com/Expensify/App/assets/78819774/d7e185b6-05cd-42a5-b1fa-31096cfc551e
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @laurenreidexpensify