-
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
Fixing incorrect message timing display when changing timezones #27838
Fixing incorrect message timing display when changing timezones #27838
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA recheck |
Reviewer Checklist
Screenshots/VideosWeb27838-web.movMobile Web - Chrome27838-web-chrome.movMobile Web - Safari27838-web-safari.movDesktop27838-desktop.moviOS27838-ios.movAndroid27838-android.mov |
@abzokhattab Videos for platforms other than web are missing - please update it. |
Videos for other platforms are now available! @burczu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed, tested and approved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add automated tests to this file to take account timeZone testing for a good spread, since this affects many locations
https://github.com/Expensify/App/blob/44b87bf1e7f56e0bfdae250de8575c577e8eb58f/tests/unit/DateUtilsTest.js
Okay, @johnmlee101 I added some unit tests for this change. All tests are passing |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/johnmlee101 in version: 1.3.75-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.75-12 🚀
|
🚀 Deployed to staging by https://github.com/johnmlee101 in version: 1.3.76-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.76-6 🚀
|
it('isToday should correctly identify today', () => { | ||
expect(DateUtils.isToday(todayInTimezone, timezone)).toBe(true); | ||
expect(DateUtils.isToday(tomorrowInTimezone, timezone)).toBe(false); | ||
expect(DateUtils.isToday(yesterdayInTimezone, timezone)).toBe(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI it looks like this is failing in early timezones like mine - see https://expensify.slack.com/archives/C01GTK53T8Q/p1699255028952729?thread_ts=1699253289.471629&cid=C01GTK53T8Q
This isn't a HUGE problem since most of our devs are in later timezones, but it's a bit annoying for me :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if these changes make sense to you @abzokhattab - they are currently passing for me: #30900
I'll run these tests again in 20 minutes, when Los Angeles becomes the same day as me :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting!
i still don't get the difference between the two approaches, aren't they returning the same result? no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will try to look into it a bit more early my timezone - I agree they look like the same approach, but somehow this let my updated test pass 😅
Details
Changes:
Replaced the
isToday
,isTomorrow
,isYesterday
functions imported fromdate-fns
to consider timezonesFixed Issues
$ #26477
PROPOSAL: #26477 (comment)
Tests
Today
is shown in the message timing for both user instead ofTomorrow
:1- Open the app and login with user A
2- Set your timezone to a timezone that will currently have previous day or next day
3- login with user B and set to to a timezone that will have the same day as today
5- From user A, send message to user B and observe that it displays 'Today' for both users
Offline tests
QA Steps
Today
is shown in the message timing for both user instead ofisTomorrow
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
Screen.Recording.2023-09-07.at.6.46.08.AM.mov
iOS
Screen.Recording.2023-09-25.at.1.03.00.PM.mov
Mobile Web - Safari
Screen.Recording.2023-09-25.at.1.34.08.PM.mov
Android
Screen.Recording.2023-09-25.at.4.20.10.PM.mov
Mobile Web - Chrome
Screen.Recording.2023-09-25.at.3.53.32.PM.mov
Desktop
Screen.Recording.2023-09-25.at.2.12.05.PM.mov