-
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
Rebuild unread reports without sequence numbers #13419
Conversation
@rushatgabhane @deetergp One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
@rushatgabhane FYI you won't be able to test this yet as it requires some back-end changes that you don't yet have access to. |
I think we should re-write these test steps so that there is less ambiguity about what we're looking for. I generally refer to any indication that a report is unread as an "unread indicator" but I think maybe you are using it to refer to the "new marker line" e.g. in step 22
If I understand this step correctly it is not the expected behavior. If you navigate away from a report that had the "new marker line" set then it should be cleared when you navigate away from the report. It shouldn't matter if you open a different report or not. |
Step 25 - Again, we should move failing tests out of the tests or test the expected behavior (even if we expect it to fail). I'd probably say we should avoid testing behaviors we know will fail because sometimes QA uses these tests in the future to assume a correct behavior. |
I think step 26 is also hard to test because it's dependent on 25.
What state should we be in for this to work? I think it's right after we mark a message as unread? But in the tests it is after we delete a report action. |
Step 31 is a little ambiguous too
Close the app how? Can we be more specific and if there are platform specific things we are doing? |
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.
Code LGTM! Ran into some trouble following the test steps. I get the sense that whatever is broken about the unread indicators at this point is consistent with staging or some possible recent regressions. I haven't looked into the source of those regressions, but certainly doesn't seem like this PR is going to make things any worse.
Thanks @marcaaron! The tests have been updated. The steps that are in the PR now should bring us up to parity with main and should all be passing. |
Reviewer Checklist
Screenshots/Videos |
should say User A opens the report, navigates to LHN?, selects a different report, navigates back to the LHN. Verify the chat in the LHN is read ? |
Found this while testing on iOS (maybe it is a known issue)
2023-01-02_14-24-35.mp4 |
Sorry this one is pretty wonky, but on mobile web (Safari) I performed these steps:
2023-01-02_14-40-41.mp4Didn't see this on any other platforms so far... |
Minor issue while testing mobile Safari (Edit: also happens on Android)
2023-01-02_14-47-54.mp4 |
Great work @puneetlath! Completed testing on various platforms. Turned up a few issues (minor I think). I'm also not certain if those are on staging or not (sorry testing took several hours). My personal opinion on this is that the things turned up are not urgent. There are a few open issues related to the unread indicators floating around and I don't think having this PR open any longer will help us solve those issues. So seeing as nothing major is broken I am 👍 That said, it does seem like something has recently regressed related to setting the "new marker" and unread status in the LHN. This stuff was working (definitely not perfectly, but I think better than it is working now) and we should commit to exploring improvements in the ReportScreen 2.0 conversation started by @roryabraham here. |
Thanks for the super thorough testing!
This one is known and exists on main too. This is the same issue as this: #13799
I wasn't able to reproduce this one on main. I'll open an issue for it. It feels sufficiently niche to not block over.
This one also exists on main. I'll open an issue.
Confirmed this is also happening on main. I'll open an issue. (link) |
Discussed on slack, i'm proceeding to merge this. |
stale review and it was tackled
✋ 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 @chiragsalian in version: 1.2.48-0 🚀
|
🚀 Deployed to production by @luacmartins in version: 1.2.48-2 🚀
|
🚀 Deployed to production by @luacmartins in version: 1.2.49-0 🚀
|
// lastActionCreated and lastReadTime are both datetime strings and can be compared directly | ||
const lastActionCreated = report.lastActionCreated || ''; | ||
const lastReadTime = report.lastReadTime || ''; | ||
return lastReadTime < lastActionCreated; |
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.
Edge case: If a chat report is empty (has no report actions except the CREATED
action) then lastReadTime
wouldn't be set and we fallback to an empty string and '' < lastActionCreated
will be true
making an empty chat unread (#38368).
On HOLD until https://github.com/Expensify/Web-Expensify/pull/35907 is live.
Details
This PR rebuilds the unread functionality to use reporAction IDs and timestamps instead of sequence numbers. At a high-level:
reportActionID
(non-sequential)created
field with millisecond precisionlastReadTime
indicating the last time that report was readlastActionCreated
indicating thereportAction.created
of the last visible report action on the reportlastReadTimes
<lastActionCreated
lastReadTime
to 1 millisecond before thereportAction.created
of that actionreportAction.created
is after thelastReadTimestamp
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/240916
$ #13472
$ #13684
Tests
Offline tests
QA Steps
Run through any existing regression tests that deal with unread chat functionality.
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)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.Screenshots/Videos
Web
Web.mov
Mobile Web - Chrome
android.chrome.mov
Mobile Web - Safari
ios.safari.mov
Desktop
desktop.mov
iOS
ios.mov
Android
android.mov