-
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
[Payment due 2024-05-15][$250] Status expiry time does not show correctly when hovering the user in the chat report #40733
Comments
Triggered auto assignment to @kadiealexander ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Inconsistency in Block Quote Usage Between Workspace Description and Chat What is the root cause of that problem?We use
inside Lines 536 to 539 in 0575c56
it's checking if the input (when will status be cleared) date is at the same day with the end of the current day. If true, it turns "until tomorrow". What changes do you think we should make in order to solve the problem?We shoudl check if the input (when will status be cleared) date is equal to the end of the current day. Then we can display "until tomorrow". if (isEqual(input, endOfToday)) {
return translateLocal('statusPage.untilTomorrow');
} After the update from When user pick "today" from the UI, the values will be like: For a user typing 11:59 PM the output will be 23:59:00 and not 23:59:59 For this we need to create an extra utility to make sure input is equal to 23:59:00 or 23:59:59 What alternative solutions did you explore? (Optional)If we need to make sure the date is tomorrow, we can adjust the code to use on the functions like isTomorrow on the date-fns library https://date-fns.org/v3.6.0/docs/isTomorrow I think the Tomorrow means that the date for clear after is:
For this, I recommended the following extended update: function isWithinBusinessHoursTomorrow(inputDate) {
const businessStart = setMinutes(setHours(inputDate, 9), 0);
const businessEnd = setMinutes(setHours(inputDate, 17), 0);
// Check if the input date is tomorrow and before business hours end
return isTomorrow(inputDate) && isBefore(inputDate, businessEnd);
}
function CheckDate({ inputDate }) {
// Convert input string to Date object if inputDate is string
const date = typeof inputDate === 'string' ? new Date(inputDate) : inputDate;
const now = new Date();
// Check if the current time is after business hours today (after 5 PM)
const afterBusinessHoursToday = isToday(date) && isAfter(now, setHours(now, 17));
// Combined logic to determine output
const isDateTomorrowBeforeBusinessHoursEnd = isWithinBusinessHoursTomorrow(date) || afterBusinessHoursToday;
return
{isDateTomorrowBeforeBusinessHoursEnd ? 'true' : 'false'}
}
|
ProposalPlease re-state the problem that we are trying to solve in this issue.Inconsistency in Block Quote Usage Between Workspace Description and Chat What is the root cause of that problem?When the input date is equal to the end of today, we show Lines 536 to 539 in 0575c56
What changes do you think we should make in order to solve the problem?Instead of Optional: If we want to show What alternative solutions did you explore? (Optional)Resultstatus_time_issue_fix.mp4 |
This comment was marked as outdated.
This comment was marked as outdated.
Proposal updated
|
ProposalPlease re-state the problem that we are trying to solve in this issue.Status expiry time does not show correctly when hovering the user in the chat report What is the root cause of that problem?Any time within today will display the message 'until tomorrow.' Lines 536 to 539 in 5832dba
What changes do you think we should make in order to solve the problem?We should use isEqual here Lines 536 to 539 in 5832dba
With just the above change, isEqual will return false for statuses set to today. This is because isEqual compares milliseconds, and since the milliseconds are different, the result is false.
What alternative solutions did you explore? (Optional)Optional: We can use Lines 533 to 534 in 5832dba
|
Job added to Upwork: https://www.upwork.com/jobs/~016ca471a846444b3a |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @cubuspl42 ( |
Proposal@cubuspl42 I extended my alternative solution with more details, no change in the RCA or the solution. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @DylanDylann ( |
@DylanDylann reassigning, please take over as C+. If you don't have bandwidth, unassign yourself. Thanks |
Please re-state the problem that we are trying to solve in this issue.Status expiry time does not show correctly when hovering the user in the chat report What is the root cause of that problem?The original issue was related to displaying the correct status expiry time based on a comparison between inputDate and the end of the current day (endOfToday). When inputDate matched the end of today, the requirement was to display the time from inputDate instead of a predefined message. What changes do you think we should make in order to solve the problem?to solve this issue we need to update this line of code Lines 536 to 539 in 0575c56
video:-https://drive.google.com/file/d/1nUm7BmV6ysaE-gV3jVDjBpo58zU5KYHo/view?usp=sharing |
From my point of view, we only display "until tomorrow" if the user selects |
ProposalPlease re-state the problem that we are trying to solve in this issue.Status expiry time does not show correctly when hovering the user in the chat report What is the root cause of that problem?Lines 536 to 539 in 5832dba
when we set a time on that day, this condition always return true because the end of day is 23:59:59 of that day What changes do you think we should make in order to solve the problem?In the document, We don't specifically mention when it will be displayed until tomorrow And let's see this line
when we set Lines 536 to 539 in 5832dba
What alternative solutions did you explore? (Optional)@DylanDylann's opinion also make sense in this case To do that we need to update the condition like that
|
@shawnborton @JmillsExpensify Could you help to confirm the expect in this case?
cc @DylanDylann |
@tienifr for your first point, how does that relate to the bug at hand? It seems like the bug reported is that if you set a custom status to expire in 30 minutes, we say it will expire "tomorrow" rather than giving an exact time. |
This bug relate to my question because this bug is that tooltip display "Until tomorrow" when setting status to expire in 30 minutes |
Triggered auto assignment to @youssef-lr, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@youssef-lr, @kadiealexander, @DylanDylann Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
@youssef-lr bump! |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
📣 @DylanDylann 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
Sounds good @DylanDylann , assigned @Krishna2323! |
📣 @Krishna2323 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
@DylanDylann, PR ready for review. |
@kadiealexander, PR deployed to production, this should be on HOLD for Payments on 2024-05-15. |
Payouts due:
Upwork job is here. |
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed: [@DylanDylann] The PR that introduced the bug has been identified. Link to the PR: #24446 Regression Test Proposal
Do we agree 👍 or 👎 |
@youssef-lr, @kadiealexander, @Krishna2323, @DylanDylann Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
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: 1.4.64-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:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @yuwenmemon
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1713818046569569
Action Performed:
Expected Result:
Should show the correct status expiry time
Actual Result:
Showing as "until tomorrow"
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Recording.3022.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @Krishna2323The text was updated successfully, but these errors were encountered: