-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[$500] Deleting the money request causes the welcome message to disappear #37576
Comments
Job added to Upwork: https://www.upwork.com/jobs/~01af5e498ce9f387d6 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @DylanDylann ( |
Triggered auto assignment to @adelekennedy ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Deleting money request report action from a new report with an account that you didn't have any contact before, causes the report's welcome message to disappear (blank ReportScreen). The report itself also disappears from LHN when clicking on another report if the only report action left is the CREATED one (welcome message). What is the root cause of that problem?We have 2 issues here:
I tested with a comment action instead and this doesn't happen, the CREATED is not set to Upon calling
Code reference for issue 2: Lines 3990 to 3993 in 48657b4
The code mentioned above is the root cause for issue 2 since the What changes do you think we should make in order to solve the problem?
Back-end: simply fix the OR Front-end.Even though as explained in the issue 1 RCA, BE sets the CREATED action to VideoScreen.Recording.2024-03-01.at.07.17.02.movThe logic which calls the App/src/pages/home/report/ReportActionsView.js Lines 154 to 166 in 48657b4
So as a FE solution we can have similar logic to call
if the conditions are both Code would look like this: useEffect(() => {
if (!_.isEmpty(props.reportActions)) {
return;
}
// if there are no reportActions including CREATED (might've been set to null by BE)
// call OpenReport to re-populate CREATED action
if (!_.some(props.reportActions, ReportActionsUtils.isCreatedAction) && isReportFullyVisible) {
openReportIfNecessary();
}
}, [props.reportActions, isReportFullyVisible]); .
Videos (main issue)MacOS: Chrome / Safari
Videos (secondary issue)MacOS: Chrome / Safari
|
ProposalPlease re-state the problem that we are trying to solve in this issue.The issue involves a user deleting a money request in a chat where they have not previously interacted with the other party, which unexpectedly results in the disappearance of the welcome message. Furthermore, this action causes the chat to vanish from the Left Hand Navigation (LHN) when the user navigates to another chat. What is the root cause of that problem?The root cause lies in the logic implemented in the application that determines whether a chat should be displayed in the LHN. The current implementation is designed to hide chats that have no interactions (messages or actions) besides the welcome message. This is based on the assumption that an empty chat or a chat with only a welcome message is not valuable to the user and clutters the LHN. Specifically, the conditional logic within the Lines 3990 to 3993 in 48657b4
What changes do you think we should make in order to solve the problem?The proposed solution involves modifying the conditional logic that determines which chats are displayed in the LHN. Rather than removing the lines of code that exclude empty chats from the LHN, a more nuanced approach should be taken to address the issue while maintaining the original intent of the logic. A proposed change could involve adding a condition that checks for the existence of a welcome message as a valid report action that qualifies the chat to remain in the LHN. This would ensure that new chats, even if their only content (a money request) is deleted, would still retain their place in the LHN due to the presence of the welcome message. Here is a pseudocode example of the proposed modification: // In App/src/libs/ReportUtils.ts, within the shouldReportBeInOptionList function
// Existing condition that checks various factors to decide if a report should be hidden
if (excludeEmptyChats && isEmptyChat && isChatReport(report) && !isChatRoom(report) && !isPolicyExpenseChat(report) && canHideReport) {
// Add an additional check to see if the report contains a welcome message
if (reportContainsWelcomeMessage(report)) {
return true; // Keep the report in the LHN if it contains a welcome message
}
return false; // Hide the chat if it doesn't meet the new condition
}
// Implement the reportContainsWelcomeMessage function to check for a welcome message in the report
function reportContainsWelcomeMessage(report) {
// Logic to determine if a welcome message exists in the report
// This would involve checking the report's actions for a specific type or marker of the welcome message
} This seems the ideal solution since we don't want to alter the original logic here as that will mess up the chat between two users who did not have the welcome message but also do not have any messages together (thus it should not show in LHN) What alternative solutions did you explore? (Optional)An alternative solution considered was the direct removal of the code lines that cause empty chats to be hidden from the LHN (or essentially have the current line return |
Updated proposal
@bernhardoj That's true, I updated my proposal mentioning that. I also tend towards a BE fix for there since it only happens with the |
@adelekennedy This is a BE bug, please help to add an internal label to get an eye from the internal engineer |
Proposal :ProblemDeleting a money request causes the welcome message to disappear in chat reports where the money request was the only message. Root CauseThe getLastVisibleMessage function in ReportUtils.ts returns a new object with only the lastMessageText property set when a money request is deleted. This overwrites the existing lastMessageText property on the report object, causing the welcome message to disappear. Proposed ChangesInstead of returning a new object with only lastMessageText when a money request is deleted, we should check if the report already has a lastMessageText property set. If it does, we should return the existing lastMessageText. This will ensure that the welcome message is not overwritten. Here's the updated code for the getLastVisibleMessage function:
Alternative SolutionsWe could consider adding additional logic to the getDeletedParentActionMessageForChatReport function to check if the report has a welcome message and return that instead of the deleted message text. However, this would add additional complexity and may not be as reliable as the proposed solution. We believe that the proposed solution is the simplest and most effective way to address this issue. |
Current assignee @DylanDylann is eligible for the Internal assigner, not assigning anyone new. |
added internal but we will need to add this to a wave/vip to get internal help - tomorrow there will be an update |
I'm a bit stuck here on the best process - I would consider this a polish since it shouldn't block a release but am not sure how to classify it in the new project board |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 1.4.44-3
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @hungvu193
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1709178638097409
Action Performed:
Expected Result:
Welcome message shouldn't disappear
Actual Result:
Welcome message disappear
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Recording.2807.mp4
bug.mov
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: