-
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
[$500] Profile - Notification preference displayed when no comment in report #34176
Comments
Job added to Upwork: https://www.upwork.com/jobs/~01cb16322001847cf2 |
Triggered auto assignment to @sonialiap ( |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @akinwale ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.The notification preference is visible on the profile with no previous conversations. What is the root cause of that problem?When deciding whether to show the notification preference, we only check it to be not hidden, and the report object to be not empty: Line 137 in ffbf5da
What changes do you think we should make in order to solve the problem?We should explicitly check if the chat is not empty, similar to how we do it on the const lastVisibleMessage = ReportActionsUtils.getLastVisibleMessage(props.report.reportID);
const isEmptyChat = !props.report.lastMessageText && !props.report.lastMessageTranslationKey && !lastVisibleMessage.lastMessageText && !lastVisibleMessage.lastMessageTranslationKey;
const shouldShowNotificationPreference = !_.isEmpty(props.report) && !isEmptyChat && props.report.notificationPreference !== CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN; Line 137 in ffbf5da
We also make similar calculations here, we can move this calculation into a separate util function: Lines 3479 to 3480 in c0c4d64
What alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.Notification preference displayed when no comment in report What is the root cause of that problem?The profile page is not checking:
What changes do you think we should make in order to solve the problem?1- We need to check if the chat is empty same as in App/src/pages/home/HeaderView.js Line 114 in 76e5b1c
2- We need to check if there was a discussion before function areDatesEqual(lastReadTime, lastVisibleActionCreated) {
// Removing the milliseconds part from the date-time strings
const lastReadTimeWithoutMillis = lastReadTime.substring(0, 19);
const lastVisibleActionCreatedWithoutMillis = lastVisibleActionCreated.substring(0, 19);
// Creating Date objects
const lastReadDate = new Date(lastReadTimeWithoutMillis);
const lastVisibleActionCreatedDate = new Date(lastVisibleActionCreatedWithoutMillis);
// Returning true if dates are equal, false otherwise
return lastReadDate.getTime() === lastVisibleActionCreatedDate.getTime();
}
const result = areDatesEqual(props.report.lastReadTime, props.report.lastVisibleActionCreated); 3- Add to Line 137 in ad583bb
Explaining:The bug reported here is for the 1st time conversation, but I noticed if there's an old conversation and it's deleted, checking only if the chat is empty will not allow editing notifications settings. I am not sure what's the righ way to do this (checking if there's an old deleted conversation) but I noticed there's a difference between Video of how deleted messages can lead to empty chat: 14.mp4What alternative solutions did you explore? (Optional)Add an utility on |
I'm a little confused about the expected result here. Could someone kindly explain how showing the notification preference when no messages have been sent is a bad thing? Does someone have to chat first before you can adjust the preference? |
@Victor-Nyagudi check #33387 |
At first, I was thinking about this scenario as well, but it looks super unlikely considering the sender will have to remove each message manually. Moreover, if the chat report is empty, it disappears from LHN in both "Last seen" and "Focus" modes, so in such a case the recipient will have to go to the search, type in the sender's details, and mute them. |
@paultsimura Let's agree to disagree :)
It's not mentioned in your proposal even in the alternative solution
it can be just one msg, mistake, wrong file..
You can see on the video I attached, it doesn't disappear. The chat is open, msg removed and user (receiver) is not able to mute cayse msg deleted.
I don't see any calculation, it's just a condition.
This is how great apps are built. Most of the issues areb super edge case but we enroll to make the app perfect. Thanks for the details, I have confidance that the C+ will take the right decision. |
@akinwale what do you think of the above proposals? |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@dragnoir I reviewed both proposals, and the expected behaviour here is that there shouldn't be a notification preference displayed whenever the report is empty, so it doesn't matter if there were previous chats that have been deleted. As long as the report is empty, the preference should not be displayed. After reviewing the proposals, we can move forward with @paultsimura's proposal. 🎀👀🎀 C+ reviewed. |
Triggered auto assignment to @Beamanator, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
Hmm @srikarparsi do you mind taking over this one since it has a lot to do with https://github.com/Expensify/Expensify/issues/330506, and specifically your changes in these two PRs? |
@akinwale I don't agree with you. For an app like expensify, perfection and focus on details is very important. The video I posted show the UX issue when someone is spamming then removing messages. Even when the app and the chat is open. I totally repect you decision but I don't agree with you. It will be another issue opened later for sure. |
That's sad but seems like you're right @srikarparsi, I cannot reproduce either 🙂 |
That's great! Happy to close this out |
@paultsimura that was a nice debate, thx for the spirit :) |
You too, man 💪 |
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.3.24
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: Applause - Internal Team
Slack conversation:
Issue found when executing PR #33387
Action Performed:
Expected Result:
In profile page, notification preference must not be displayed when there is no comment in report.
Actual Result:
In profile page, notification preference section is displayed when there is no comment/chat in report.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6336979_1704824035182.az_recorder_20240109_190136.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: