Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Feature: refactor requiresAttentionFromCurrentUser function #32140
Feature: refactor requiresAttentionFromCurrentUser function #32140
Changes from 2 commits
071db61
14c7e9b
ffe819a
03c3dce
88bee57
a4dcc97
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Couldn't this just be this:
Because if report.UnreadWithMention is undefined or null it'll be false? Or will it throw?
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.
Ah, no, that was added because isUnreadWithMention is not exist in OnyxEntry and thats a verification to pass TS.
Boolean(report.isUnreadWithMention) - this will cause an error: Property 'isUnreadWithMention' does not exist on type 'Report | OptionData'.
Property 'isUnreadWithMention' does not exist on type '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.
Ahh ok, I see. Perhaps then, instead of calling the argument
report
we should call itreportOrOption
. So that it's more clear that the thing we are doing these checks on could be a report or option.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.
Looks like
isWaitingForAssigneeToCompleteTask
expects the first param to be report not an option.https://github.com/Expensify/App/pull/32140/files#diff-577fcc5f3a5e4930916ff310e61c38edfa093792fe3ab55b9a30d2aecd8811dbR1511
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.
But only for option it was used
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 raised this because first param
report
ofisWaitingForAssigneeToCompleteTask
has typeOnyxEntry<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.
Restricting the use of
isWaitingForAssigneeToCompleteTask
will change order of the report asrequiresAttentionFromCurrentUser
is being used in SidebarUtils to get ordered reportIDs (getOrderedReportIDs
). This is the comparison between staging and PR.Staging
Screen.Recording.2023-12-05.at.21.03.59.mov
PR
Screen.Recording.2023-12-05.at.21.04.31.mov
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.
Yes, this is a correct behaviour, this one related to this issue which this PR should fix!
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.
We can notice change in other chats with green dot indicator as well. Please let me know if it is expected.
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.
Deleted tasks were created from "fds"?
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 is the content of task fds
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.
Okay, agree, it was an issue, researched into the old code(before rewriting this function at all)
There was an issue before that in SidebarUtils
getOrderedReportIDs
we didnt use at all the "isWaitingForAssigneeToCompleteTask", but its in the function, but another part of the SidebarUtils were using "isWaitingForAssigneeToCompleteTask", but I removed it fully for reports, thats why this issue were happening.Updated the code, removed isOption verification as its not needed anymore, added "reportAction" to "getOrderedReportIDs" for a correct behaviour, please retest and let me know
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.
Thanks for the update @waterim.