You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[hold for payment 2024-08-26] [$250] Split - Unable to split expense with workspace via FAB #47159
BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in review
Version Number: 9.0.18-7 Reproducible in staging?: Y Reproducible in production?: N If this was caught during regression testing, add the test name, ID and link from TestRail:N/A Email or phone of affected tester (no customers):applausetester+kh050806@applause.expensifail.com Issue reported by: Applause - Internal Team
Action Performed:
Go to staging.new.expensify.com
Go to FAB > Split expense > Manual
Enter amount > Next
Select a workspace > Next
Split the expense
Expected Result:
The expense is split in the workspace chat
Actual Result:
User is unable to split expense with workspace via FAB
App opens a report with RBR on LHN and the report shows infinite skeleton after splitting expense with workspace via FAB
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
Edited by proposal-police: This proposal was edited at {current_timestamp}.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Can't split bill with workspace from FAB.
What is the root cause of that problem?
When we split bill with a workspace from FAB, we create a new workspace chat even though there is already a workspace chat. The reason we create a new workspace is because the existing chat report ID below is empty, so getOrCreateOptimisticSplitChatReport decide to create a new report.
When we split bill from FAB, existingSplitChatReportID will be an empty string and if the participant is a workspace, then participants[0].reportID will contain the workspace reportID.
But now, we use ?? which won't fallback to participants[0].reportID because existingSplitChatReportID is an empty string. The logic is updated by this commit.
What changes do you think we should make in order to solve the problem?
Based on the commit message, we don't want an undefined existingChatReportID which is possible if the participant is not a workspace.
That's why we fall back again to an empty string. But we shouldn't use ?? specifically for existingSplitChatReportID because it's an empty string and not undefined.
Btw, I think we should fall back to -1 or just let it be undefined again. If it's an empty string, then the report onyx key will be report_ which will fetch the whole report collection.
I think the reason we don't want the reportID to be undefined (report_undefined) is that sometimes the invalid report exists in the storage with error data, without a reportID.
report_undefined: {
errors: ...,
}
And because the report object is not undefined, the logic thinks that it found an existing report, even though it doesn't.
changed the title [-]Split - Unable to split expense with workspace via FAB[/-][+][$250] Split - Unable to split expense with workspace via FAB[/+]on Aug 9, 2024
changed the title [-][$250] Split - Unable to split expense with workspace via FAB[/-][+][hold for payment 2024-08-26] [$250] Split - Unable to split expense with workspace via FAB[/+]on Aug 26, 2024
A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: N/A
Determine if we should create a regression test for this bug: 🚫 No, because it was a DB, I think we already have a regression test for this bug.
BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in review
Activity
melvin-bot commentedon Aug 9, 2024
Triggered auto assignment to @grgia (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.github-actions commentedon Aug 9, 2024
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
lanitochka17 commentedon Aug 9, 2024
We think that this bug might be related to #vip-split
bernhardoj commentedon Aug 9, 2024
Edited by proposal-police: This proposal was edited at {current_timestamp}.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Can't split bill with workspace from FAB.
What is the root cause of that problem?
When we split bill with a workspace from FAB, we create a new workspace chat even though there is already a workspace chat. The reason we create a new workspace is because the existing chat report ID below is empty, so
getOrCreateOptimisticSplitChatReportdecide to create a new report.App/src/libs/actions/IOU.ts
Lines 3812 to 3814 in db669c4
Previously, the logic look like this:
When we split bill from FAB,
existingSplitChatReportIDwill be an empty string and if the participant is a workspace, thenparticipants[0].reportIDwill contain the workspacereportID.But now, we use
??which won't fallback toparticipants[0].reportIDbecauseexistingSplitChatReportIDis an empty string. The logic is updated by this commit.What changes do you think we should make in order to solve the problem?
Based on the commit message, we don't want an undefined
existingChatReportIDwhich is possible if the participant is not a workspace.That's why we fall back again to an empty string. But we shouldn't use ?? specifically for
existingSplitChatReportIDbecause it's an empty string and not undefined.So, to fix this, we should change
??to||back.Btw, I think we should fall back to -1 or just let it be undefined again. If it's an empty string, then the report onyx key will be
report_which will fetch the whole report collection.App/src/libs/actions/IOU.ts
Line 3817 in db669c4
I think the reason we don't want the
reportIDto beundefined(report_undefined) is that sometimes the invalid report exists in the storage with error data, without areportID.And because the report object is not undefined, the logic thinks that it found an existing report, even though it doesn't.
App/src/libs/actions/IOU.ts
Lines 3820 to 3828 in db669c4
To fix this, we can check for the
reportIDto make sure the report object is valid.[-]Split - Unable to split expense with workspace via FAB[/-][+][$250] Split - Unable to split expense with workspace via FAB[/+]melvin-bot commentedon Aug 9, 2024
Job added to Upwork: https://www.upwork.com/jobs/~01fde995cf07525892
melvin-bot commentedon Aug 9, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @hoangzinh (
External)27 remaining items
bernhardoj commentedon Aug 13, 2024
PR is ready
cc: @hoangzinh
joekaufmanexpensify commentedon Aug 19, 2024
PR merged!
joekaufmanexpensify commentedon Aug 26, 2024
Hmm, automation did not work here. This went out to prod over a week ago, so payment is due now. Will tackle payment in the next day or so!
[-][$250] Split - Unable to split expense with workspace via FAB[/-][+][hold for payment 2024-08-26] [$250] Split - Unable to split expense with workspace via FAB[/+]hoangzinh commentedon Aug 27, 2024
BugZero Checklist:
joekaufmanexpensify commentedon Aug 27, 2024
Sounds good. TY!
joekaufmanexpensify commentedon Aug 27, 2024
All set to issue payment here. We need to pay:
joekaufmanexpensify commentedon Aug 27, 2024
@hoangzinh $250 sent and contract ended!
joekaufmanexpensify commentedon Aug 27, 2024
Upwork job closed.
joekaufmanexpensify commentedon Aug 27, 2024
Closing as only thing left here is for @bernhardoj to request payment via NewDot!
bernhardoj commentedon Aug 27, 2024
Requested in ND.
JmillsExpensify commentedon Aug 28, 2024
$250 approved for @bernhardoj