fix: make consistent behavior of displaying green line for assign task#51174
Conversation
|
@dukenv0307 Please 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] |
|
@dukenv0307 I updated. |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-10-31.at.16.09.38.movAndroid: mWeb ChromeScreen.Recording.2024-10-22.at.14.47.29.moviOS: NativeScreen.Recording.2024-10-31.at.16.07.09.moviOS: mWeb SafariScreen.Recording.2024-10-22.at.14.46.43.movMacOS: Chrome / SafariScreen.Recording.2024-10-22.at.14.43.15.movMacOS: DesktopScreen.Recording.2024-10-31.at.21.04.32.mov |
|
@daledah This issue still can reproduce on ios native Screen.Recording.2024-10-22.at.18.06.20.mov |
|
@dukenv0307 Investigating, will update soon. |
|
I found the RCA on native device:
So we have unreadMarkerReportActionID
So the I'm trying to find the solution |
we can consider to use |
|
@dukenv0307 Can you take a look at it? Thanks |
|
@daledah Looks promising, can you update your PR with that change? Thanks |
|
@dukenv0307 I updated. |
|
@dukenv0307 I updated. Tests well on my end. |
|
LGTM and tests well |
|
@stitesExpensify I updated. |
|
@stitesExpensify We're good to merge |
|
@stitesExpensify Can you review again please? |
|
@stitesExpensify we're good to merge |
|
✋ 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/stitesExpensify in version: 9.0.62-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.0.62-4 🚀
|
tgolen
left a comment
There was a problem hiding this comment.
Please revert this PR due to the bad patterns it introduces.
| return allReports[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]; | ||
| } | ||
|
|
||
| function updateReportData(reportID: string, reportData?: Partial<Report>) { |
There was a problem hiding this comment.
Please remove this function. Any data in Onyx that needs to be updated should be done via one of the proper Onyx methods (merge, set, etc.).
This method will introduce bad side-effects which could have unknown consequences and lead to many bugs without the ability to track them down.
There was a problem hiding this comment.
There was a problem hiding this comment.
FYI I'm working on the PR where ReportConnection file is removed. There updateReportData function usage is replaced with Onyx.merge
There was a problem hiding this comment.
Just to confirm, @stitesExpensify was there any specific reason why you created this function instead of using Onyx.merge?
There was a problem hiding this comment.
To clarify, this was written by @daledah I was just the reviewer, so I'll leave that answer to him
There was a problem hiding this comment.
As I said in the proposal. createTaskAndNavigate will update lastReadTime as currentTime. After that we dismiss modal and navigate to report:
Line 304 in ce23fb5
lastReadTime here: App/src/libs/actions/Report.ts
Line 955 in e9de4f2
That’s the reason we decided to use getReport to get the up-to-date data.
I think we can’t use useOnyx in this case since its value can be outdated in this case. Please forgive me If I did something wrong, I’ll raise other PR to fix If we have the better idea.
There was a problem hiding this comment.
@daledah Can you remove your change and test the original issue? I think it's fixed somewhere else.
| const prevSortedVisibleReportActionsObjects = usePrevious(sortedVisibleReportActionsObjects); | ||
|
|
||
| const reportLastReadTime = useMemo(() => { | ||
| return ReportConnection.getReport(report.reportID)?.lastReadTime ?? report.lastReadTime ?? ''; |
There was a problem hiding this comment.
This should never use getReport() from a lib. It should be useOnyx instead to connect to the report data.
| const [unreadMarkerTime, setUnreadMarkerTime] = useState(reportLastReadTime); | ||
| useEffect(() => { | ||
| setUnreadMarkerTime(report.lastReadTime ?? ''); | ||
| setUnreadMarkerTime(reportLastReadTime); | ||
|
|
||
| // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps | ||
| }, [report.reportID]); |
There was a problem hiding this comment.
Causes this issue: #53000
More details: #53000 (comment)
Details
Fixed Issues
$ #50792
PROPOSAL: #50792 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2024-10-22.at.02.24.35.mov
Android: mWeb Chrome
Screen.Recording.2024-10-22.at.02.26.51.mov
iOS: Native
Screen.Recording.2024-10-22.at.02.34.53.mov
iOS: mWeb Safari
Screen.Recording.2024-10-22.at.02.37.05.mov
MacOS: Chrome / Safari
Screen.Recording.2024-10-21.at.17.52.39.mp4
MacOS: Desktop
Screen.Recording.2024-10-22.at.02.40.25.mov