-
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
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 🚀
|
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Navigation.dismissModal(parentReportID); |
lastReadTime
here: App/src/libs/actions/Report.ts
Line 955 in e9de4f2
parameters.clientLastReadTime = ReportConnection.getAllReports()?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]?.lastReadTime ?? ''; |
const [unreadMarkerTime, setUnreadMarkerTime] = useState(report.lastReadTime ?? ''); |
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@daledah Can you remove your change and test the original issue? I think it's fixed somewhere else.
@@ -210,6 +211,10 @@ function ReportActionsList({ | |||
); | |||
const prevSortedVisibleReportActionsObjects = usePrevious(sortedVisibleReportActionsObjects); | |||
|
|||
const reportLastReadTime = useMemo(() => { | |||
return ReportConnection.getReport(report.reportID)?.lastReadTime ?? report.lastReadTime ?? ''; |
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.
This should never use getReport()
from a lib. It should be useOnyx
instead to connect to the report data.
Details
Fixed Issues
$ #50792
PROPOSAL: #50792 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.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
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