-
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
Refactor Update Last Read #9529
Conversation
Updated and tested, this is ready for review |
Adding @arosiclair as well since he is tagged on the Web-E PR |
I'm seeing an issue where occasionally the report is marked as read briefly and then goes back to unread after switching to it. Seems to be caused by Will the functionality for Screen.Recording.2022-06-30.at.10.22.43.AM.mov |
@madmax330 also you have to flesh out your QA steps (even if its just "same as tests") and screenshots sections |
Good observation, Report_GetHistory is a separate refactor that will update this behavior. See: https://github.com/Expensify/Expensify/issues/212871#issuecomment-1168063361
Good call.
Not sure what to include for this still since it's not a UI change really, but I'll include a video or the indicator updating and the network tab to show that we're making the requests to the new API |
Updated and added a description to the screenshots section |
Thanks but you'll have to include recordings for each platform unfortunately since this is UI behavior we're implementing. I'll be testing this on each platform too (minus Android since the build is broken on M1 right now). |
Cool, I've added videos for mweb, and desktop. I'll add ios, and android sometime next week b/c it's not working rn.
I don't agree with this. These changes don't modify or add any UI components so none of the components will look different than they did before this PR. |
I don't like the cross-platform testing requirement for functional changes either, but the guidelines don't really give us an exception. I'll ask for clarification in eng-chat. EDIT: sounds like we should |
@@ -201,6 +202,7 @@ class ReportActionsView extends React.Component { | |||
|
|||
componentDidUpdate(prevProps) { | |||
if (prevProps.network.isOffline && !this.props.network.isOffline) { | |||
Report.openReport(this.props.reportID); | |||
this.fetchData(); |
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.
Just noting: Once the report actions fetching stuff is refactored this call should not be here anymore. cc @sketchydroide
udpate branch
I was retesting this and it seems nothing is ever unread anymore. Screen.Recording.2022-07-06.at.10.58.44.PM.movI'm on latest web and app, I think it's the |
Shouldn't need any Auth changes. Is it broken if you switch to |
Yeah it's broken on main for me. |
Ok, it does seem like something is broken 😬 On a fresh chat with a new user it will show as unread, but leaving additional comments and they are not showing as unread. Will take a look (unless you have an idea about what is broken). |
I don't, but I can look as well 🙃 |
Just documenting here what I am seeing as well... first comment from a user seems OK later comments not so much. 2022-07-07_07-44-23.mp4 |
Ok so doing some debugging and I think it has to do with the timestamp check. For some reason, the timestamp of the actions getting created on dev is off by a solid 30 seconds. That means the logic here won't run... App/src/libs/actions/Report.js Lines 1495 to 1498 in eb54f23
Seems to work ok on staging though. |
Ok, so pretty weird stuff, but I think we are both affected by the VM clock drifting based on this thread -> https://expensify.slack.com/archives/C03TQ48KC/p1657218624480699 After a Which also explains why nobody noticed this and why it worked fine for me before but suddenly stopped working 😓 |
Oh wow, you're right, restarting the vm fixed it. I wonder what happened between yesterday and the day before for my clock to skew by 30s 😕 |
Aright, I addressed the comments and re-tested. |
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.
Sorry @madmax330 meant to approve this but changes LGTM. Gonna wrap up a few other things in my open PR so you don't get clobbered with conflicts 😅
onyxMethod: 'merge', | ||
key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, | ||
value: { | ||
lastVisitedTimestamp: Math.round(Date.now() / 1000), |
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.
NAB and sorry, as mentioned in that other comment I was wrong about this and Date.now()
is totally fine to use as it returns milliseconds and the lastVisitedTimestamp should be in ms
.
@marcaaron looks like this was merged without passing tests. Please add a note explaining why this was done and remove the |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
GH actions did pass. |
🚀 Deployed to staging by @marcaaron in version: 1.1.83-1 🚀
|
🚀 Deployed to production by @chiragsalian in version: 1.1.84-13 🚀
|
Details
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/212871
Tests
Verify that no errors appear in the JS console
In one chrome log into newDot
In another incognito window log into another account on newDot
Send messages to the first user
If this is a new chat make sure when you click on the chat the messages are marked as read
If this is an existing chat:
PR Review Checklist
Contributor (PR Author) Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
displayName
propertythis
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)PR Reviewer Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesSTYLE.md
) were followed/** comment above it */
displayName
propertythis
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)QA Steps
See "Tests"
Screenshots
This is not a UI change, so I tested on web to show the right network requests being made to the new API commands
Web
update.read.mov
Mobile Web
Screen.Recording.2022-07-01.at.7.10.54.PM.mov
Desktop
Screen.Recording.2022-07-01.at.7.07.51.PM.mov
iOS
Android