Closed lanitochka17 closed 2 months ago
Triggered auto assignment to @bfitzexpensify (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-vsp
@bfitzexpensify 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
Edited by proposal-police: This proposal was edited at 2024-08-16 12:36:08 UTC.
On deleting parent message,text "Deleted message" is not shown
We are using getGroupChatName
to get the report name here
https://github.com/Expensify/App/blob/d4d5a2586910ff46147219ee3e98bb3e936f8037/src/pages/ReportDetailsPage.tsx#L244-L245
Because isGroupChat
will be true for chat threads opened inside group chats
isGroupChat
is not enough and we also need to check that it is not chat thread
const reportName = ReportUtils.isDeprecatedGroupDM(report) || (isGroupChat && !isChatThread) ? ReportUtils.getGroupChatName(undefined, false, report) : ReportUtils.getReportName(report);
or
const reportName = ReportUtils.isDeprecatedGroupDM(report) || (isGroupChat && !isThread) ? ReportUtils.getGroupChatName(undefined, false, report) : ReportUtils.getReportName(report);
same fix should be applied here too if we are not going to update isGroupChat
as suggested in my alternative approach (which fix the problem from the root cause)
https://github.com/Expensify/App/blob/578006fe4d2b7ba13155e795bcef541019aad8ea/src/components/LHNOptionsList/OptionRowLHN.tsx#L134
As chat threads with group chat as their parent report also have chatType
as group; everywhere we are using isGroupChat
in the app, we are wrongly including these chat threads. so the current code to determine isGroupChat is not correct and the one we should fix it from the root cause and avoid similar problems in the whole code base
https://github.com/Expensify/App/blob/d4d5a2586910ff46147219ee3e98bb3e936f8037/src/libs/ReportUtils.ts#L1140-L1141 so should be changed to
return getChatType(report) === CONST.REPORT.CHAT_TYPE.GROUP && !isThread(report);
If a thread is created on a group chat and the thread is deleted with a message, the report detail page shows the thread name instead of [Deleted message]
If the report is a group chat, then we use getGroupChatName
to get the name. A thread always inherits its parent chat type, so a thread in a group chat is a group chat.
https://github.com/Expensify/App/blob/578006fe4d2b7ba13155e795bcef541019aad8ea/src/pages/ReportDetailsPage.tsx#L244
getGroupChatName
itself returns the reportName
of a report if found and a thread reportName
is the thread parent message.
https://github.com/Expensify/App/blob/578006fe4d2b7ba13155e795bcef541019aad8ea/src/libs/ReportUtils.ts#L2140-L2144
Remove the group chat check and just use ReportUtils.getReportName
. ReportUtils.getReportName
already handles the group chat case.
https://github.com/Expensify/App/blob/578006fe4d2b7ba13155e795bcef541019aad8ea/src/libs/ReportUtils.ts#L3736-L3738
We need to fix in OptionRowLHN too by removing the group chat check. https://github.com/Expensify/App/blob/578006fe4d2b7ba13155e795bcef541019aad8ea/src/components/LHNOptionsList/OptionRowLHN.tsx#L134
@bfitzexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!
Job added to Upwork: https://www.upwork.com/jobs/~0129be1229dfa60701
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ahmedGaber93 (External
)
@bernhardoj In details page getGroupChatName
use shouldApplyLimit
with false value but getReportName
use it with true value
https://github.com/Expensify/App/blob/d4d5a2586910ff46147219ee3e98bb3e936f8037/src/pages/ReportDetailsPage.tsx#L244-L245
I know this is may achieve the desired consistency in the other issue, but can you please add more context about this change affect? FYI, they have been added in this PR https://github.com/Expensify/App/pull/40134
Beside the limit, the change will simply make it consistent with other parts of the app where we prioritize other naming case before the group chat, such as the thread.
Btw, if we look at the PR changes for ReportDetailsPage, we can see that previously we passed shouldApplyLimit
as true.
Then, there is a discussion in the PR whether it's safe to pass shouldApplyLimit
as true in ReportSettingsPage where we previously pass it as false. Then, this commit comes as the result of the discussion which changes shouldApplyLimit
as false in ReportDetailsPage instead of ReportSettingsPage.
So, I think it's an overlook when changing the code.
In group chat, on deleting parent message, the text " Deleted message " is not shown under avatar
The thread of a group chat also has a chat type group
then in this case we get the wrong report name of the thread by calling getGroupChatName
We should only get the report name by calling getGroupChatName
if the chat has a chat type group
and not is a thread. We already have isRootGroupChat
function that covers this case
const reportName = ReportUtils.isRootGroupChat(report) ? ReportUtils.getGroupChatName(undefined, false, report) : ReportUtils.getReportName(report);
We also need to fix in LHN here
const isGroupChat = ReportUtils.isRootGroupChat(report);
@bernhardoj's proposal LGTM!
getReprtName
has the two cases isChatThread and isGroupChat that needed to fix this issue, also getReprtName
used on the header here so using it on details page can fix the consistency issue https://github.com/Expensify/App/issues/47803
π π π C+ reviewed
Triggered auto assignment to @francoisl, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
π£ @ahmedGaber93 π An offer has been automatically sent to your Upwork account for the Reviewer role π Thanks for contributing to the Expensify app!
Not overdue, the issue has just been assigned and we are waiting PR.
PR is ready
cc: @ahmedGaber93
I am heading out of office until September 21st, so assigning a buddy to watch over this in my absence.
Current status: PR in review
Triggered auto assignment to @miljakljajic (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.
@bfitzexpensify my leave starts tomorrow so I will leave this with you
Do we agree π or π
@bfitzexpensify Bump for payment, The production deploy automation failed, but based on this deploy checklist https://github.com/Expensify/App/issues/48954 This is issue was due for payment 2024-09-18.
@bfitzexpensify Bump ^
Payment summary:
@ahmedGaber93 due $250 for C+ work - offer sent via Upwork @bernhardoj due $250 for contributor work via manual request
Requested in ND.
$250 approved for @bernhardoj
@bfitzexpensify Offer accepted.
Payment complete.
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 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:
In group chat, on deleting parent message, the text " Deleted message " must be shown under avatar
Actual Result:
In group chat, on deleting parent message, the text " Deleted message " is not shown under avatar
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
https://github.com/user-attachments/assets/c966a403-c557-40f0-be97-ac1f03bf8ea5
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @ahmedGaber93