-
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
[Backwards compatibility] [$250] LHN - GRB not removed from workspace when moving report to another workspace in OD #46287
Comments
Triggered auto assignment to @johncschuster ( |
@johncschuster 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 |
@johncschuster Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Job added to Upwork: https://www.upwork.com/jobs/~01b2e9e01981038ce0 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @thesahindia ( |
Edited by proposal-police: This proposal was edited at 2024-08-11 21:57:55 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.GRB and Subtitle do not change after a move expense to another workspace What is the root cause of that problem?So, has the subtitle not changed because the "report?.lastMessageText" in this code still contains old data like"[policyName] owes [currency]1.00" App/src/libs/OptionsListUtils.ts Line 746 in ad906ad
As a result, we set "lastMessageText" to "result.alternateText" here. Line 438 in 899e287
GBR we set here: Line 345 in 899e287
We retrieve it from the backend server. The only way to fully update is to click the "new message" button or reopen the report, which triggers an action called OpenReport. What changes do you think we should make in order to solve the problem?To accomplish this, we'll need to create two functions: allExpenseActionsDeleted and someExpenseActionsDeleted. allExpenseActionsDeleted will check if all ReportAction items with the type Expense have been deleted. function allExpenseActionsDeleted(reportActions: OnyxEntry<ReportActions>): boolean {
return Object.entries(reportActions ?? {})
.filter(([, action]) => {
return action.childType === CONST.REPORT.TYPE.EXPENSE;
})
.every(([, action]) => ReportActionsUtils.isDeletedAction(action) || action.childStatusNum === CONST.REPORT.STATUS_NUM.REIMBURSED);
}
function someExpenseActionsDeleted(reportActions: OnyxEntry<ReportActions>): boolean {
return Object.entries(reportActions ?? {})
.filter(([, action]) => {
return action.childType === CONST.REPORT.TYPE.EXPENSE;
})
.some(([, action]) => ReportActionsUtils.isDeletedAction(action) || action.childStatusNum === CONST.REPORT.STATUS_NUM.REIMBURSED);
} If all of them have been deleted, we'll set result.hasOutstandingChildRequest to false and also fetch the last visible message in the report to update result.alternateText. if (ReportUtils.allExpenseActionsDeleted(reportActions)) {
lastMessageTextFromReport = ReportActionsUtils.getLastVisibleMessage(report.reportID, {}, lastAction)?.lastMessageText;
result.hasOutstandingChildRequest = false;
} else if (ReportUtils.someExpenseActionsDeleted(reportActions)) {
result.hasOutstandingChildRequest = true;
} Also, we need to change lastMessageTextFromReport from const to let Proof of concept: 2024-08-12.02-17-45.mp4 |
@thesahindia can you take a look at the above proposal? |
Could you share a video? @Amoralchik, the proposal didn't fix it for me. |
@thesahindia |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@johncschuster, @thesahindia Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
@thesahindia bump on the comment above |
@thesahindia I conducted extensive testing and attempts to find a way to fix the GBR issue. I noticed that hasOutstandingChildRequest, which causes GBR, is obtained solely from the report already in ONYX. When an update is triggered by moving an expense to another workspace, we do not receive hasOutstandingChildRequest to change it from true to false. Meanwhile, the last report action is updated, but it still lacks sufficient data to accurately change hasOutstandingChildRequest. The only effective solution I found was to add ReportActions.openReport(fullReport?.reportID ?? '-1'); in OptionRowLHNData. This way, we could retrieve the report with the updated hasOutstandingChildRequest, but it would generate many requests and potentially lead to performance degradation. Regarding the lastMessageText, as I suggested in the proposal, we can try to fix it. |
Bumped in Slack |
@puneetlath @greg-schroeder @JmillsExpensify here's another interesting one for backwards compatibility. Sounds like we need to make sure the GBR moves accordingly as well. |
I'm sorry for the noise, @mollfpr. I accidentally hotkeyed the label. I... didn't realize I could call the label menu with keystrokes. |
Discussed in Slack – this is currently a lower priority issue. I'm going to bump this to weekly and keep checking in on the urgency each week. |
Bumped. Still a lesser priority |
Bumped in Slack to see if the priority has changed. |
@johncschuster We can use my Propoasal as a workaround for this issues |
@Amoralchik, I'm happy to assign to you, but please wait until I've had an internal engineer verify that your proposal is the path forward. |
Actually, I'm reviewing the issue with fresh eyes, and I don't think we want to apply a workaround for this one. Both @thesahindia and @shubham1206agra suggested against the proposed solution, and suggested we move this |
@johncschuster |
Bumping in Slack to get a sense check of the priority |
Still low priority |
No update. Keeping this |
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: 9.0.13.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
Issue found when executing PR #45970
Action Performed:
and log in with an account that has several workspace
Expected Result:
The GRB is removed from the workspace since the report was moved to another workspace
Actual Result:
The GRB is still displayed and workspace preview in LHN shows " owes " until the workspace chat is opened
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6552887_1721926476541.Recording__640.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @mollfprThe text was updated successfully, but these errors were encountered: