Closed IuliiaHerets closed 2 months ago
Triggered auto assignment to @jliexpensify (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.
We think that this bug might be related to #vip-vsb
@jliexpensify 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
After leaving a thread, opening it again causes you to get thrown back to the group chat
The root cause of the problem is the isRemovalExpectedForReportType
check in the useEffect
in ReportScreen.tsx
, which becomes true because of || ReportUtils.isGroupChat(prevReport)
https://github.com/Expensify/App/blob/62722e8bc636f1be2e2c9e8e980aac93b76804c9/src/pages/home/ReportScreen.tsx#L583
The fix for this is altering the check to make it something like: || (ReportUtils.isGroupChat(prevReport) && !ReportUtils.isThread(prevReport))
, which will still make it true if the user leaves the entire group chat, but will be false for threads. After that, the group chat opening doesn't happen anymore, but I noticed that the thread updates (the "left the chat" message) appears after a delay, which is caused by the following lines:
https://github.com/Expensify/App/blob/62722e8bc636f1be2e2c9e8e980aac93b76804c9/src/libs/actions/Report.ts#L2811-L2825
https://github.com/Expensify/App/blob/62722e8bc636f1be2e2c9e8e980aac93b76804c9/src/libs/actions/Report.ts#L2834-L2839
which makes the thread "hidden", without actually forcing the thread to reload after the user leaves. If the loading delay is an issue worth fixing, then it can be done by removing the || IsChatThread
part of the check.
Result (with both fixed applied): https://github.com/user-attachments/assets/dfac5144-7a01-45ab-b270-ff7f7855a268
Still looks to be happening on v9.0.21-3. Going to try and get this fixed because it affects everyone.
Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @paultsimura (External
)
Job added to Upwork: https://www.upwork.com/jobs/~01ce5b7018d6f6dd8e
Current assignee @paultsimura is eligible for the External assigner, not assigning anyone new.
Thread appears for a moment and redirect to group chat
After we leave a group chat thread and open it again, GetMissingOnyxMessages
is called and returns the data that sets the thread report as null (see the image below).
Then because the report is empty and this thread is also a group chat, isRemovalExpectedForReportType
is true
and we will navigate back to parent report here
https://github.com/Expensify/App/blob/62722e8bc636f1be2e2c9e8e980aac93b76804c9/src/pages/home/ReportScreen.tsx#L581-L583
We should use isRootGroupChat
check here that also covers the isDeprecatedGroupDM
case and exclude the case the thread is a group chat
const isRemovalExpectedForReportType =
isEmpty(report) &&
(ReportUtils.isMoneyRequest(prevReport) || ReportUtils.isMoneyRequestReport(prevReport) || ReportUtils.isPolicyExpenseChat(prevReport) || ReportUtils.isRootGroupChat(prevReport));
NA
Opening a group chat occurs when leaving and reopening a thread.
There is inconsistencies between FE and BE, while FE only hide the notification preferences. But BE set the report to null.
If we want to handle it in BE then BE should sent the below code instead of setting report to null.
{
notificationPreference: CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN,
participants: {
[currentUserAccountID]: {
hidden: true,
},
},
}
if we want to resolve it in FE, we can remove || isChatThread
here and here.
N/A
Commenting to get the engineer's eyes:
🎀👀🎀 C+ reviewed
Triggered auto assignment to @srikarparsi, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
Hey @srikarparsi.
As the Contributors have pointed out correctly, after leaving the thread and re-visiting it, the GetMissingOnyxMessages
API call returns an Onyx operation that removes the thread:
Is it expected for some memory optimization reasons? Should we build a FE fix around it, or change the BE behavior as @wildan-m suggested?
The FE fix works but it requires a full chat reload as it gets removed and re-fetched:
https://github.com/user-attachments/assets/e923ec44-40f0-48ad-9414-18e1fded92f6
Agreed, this should be fixed in the backend. Working on a PR to do this.
@srikarparsi could you please remove the "external" and "help wanted" labels?
@paultsimura, @jliexpensify, @srikarparsi Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
The backend fix took care of this, closing this out.
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.21-1 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4865736 Email or phone of affected tester (no customers): applausetester+jp_e_category_2@applause.expensifail.com Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
Thread opens
Actual Result:
Thread appears for a moment and redirect to group chat
Workaround:
Unknown
Platforms:
Screenshots/Videos
https://github.com/user-attachments/assets/f9a3af3c-7c8c-4f4d-8c3b-0fe05bf3aa9a
View all open jobs on GitHub
Issue Owner
Current Issue Owner: @Upwork Automation - Do Not Edit