-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Fix double-computation of requiresAttentionFromCurrentUser in LHN filter loop #84005
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
Changes from all commits
1d554ee
a098f5f
209c16e
771dbc0
dc41d99
98d7c99
c23f7ac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1021,7 +1021,7 @@ | |
| }; | ||
|
|
||
| let conciergeReportIDOnyxConnect: OnyxEntry<string>; | ||
| Onyx.connect({ | ||
| key: ONYXKEYS.CONCIERGE_REPORT_ID, | ||
| callback: (value) => { | ||
| conciergeReportIDOnyxConnect = value; | ||
|
|
@@ -1029,7 +1029,7 @@ | |
| }); | ||
|
|
||
| const defaultAvatarBuildingIconTestID = 'SvgDefaultAvatarBuilding Icon'; | ||
| Onyx.connect({ | ||
| key: ONYXKEYS.SESSION, | ||
| callback: (value) => { | ||
| // When signed out, val is undefined | ||
|
|
@@ -1047,7 +1047,7 @@ | |
| let allPersonalDetails: OnyxEntry<PersonalDetailsList>; | ||
| let allPersonalDetailLogins: string[]; | ||
| let currentUserPersonalDetails: OnyxEntry<PersonalDetails>; | ||
| Onyx.connect({ | ||
| key: ONYXKEYS.PERSONAL_DETAILS_LIST, | ||
| callback: (value) => { | ||
| if (currentUserAccountID) { | ||
|
|
@@ -1059,7 +1059,7 @@ | |
| }); | ||
|
|
||
| let allReportsDraft: OnyxCollection<Report>; | ||
| Onyx.connect({ | ||
| key: ONYXKEYS.COLLECTION.REPORT_DRAFT, | ||
| waitForCollectionCallback: true, | ||
| callback: (value) => (allReportsDraft = value), | ||
|
|
@@ -1067,7 +1067,7 @@ | |
|
|
||
| let allPolicies: OnyxCollection<Policy>; | ||
| let policiesArray: Policy[] = []; | ||
| Onyx.connect({ | ||
| key: ONYXKEYS.COLLECTION.POLICY, | ||
| waitForCollectionCallback: true, | ||
| callback: (value) => { | ||
|
|
@@ -1077,7 +1077,7 @@ | |
| }); | ||
|
|
||
| let allPolicyDrafts: OnyxCollection<Policy>; | ||
| Onyx.connect({ | ||
| key: ONYXKEYS.COLLECTION.POLICY_DRAFTS, | ||
| waitForCollectionCallback: true, | ||
| callback: (value) => (allPolicyDrafts = value), | ||
|
|
@@ -1085,7 +1085,7 @@ | |
|
|
||
| let allReports: OnyxCollection<Report>; | ||
| let reportsByPolicyID: ReportByPolicyMap; | ||
| Onyx.connect({ | ||
| key: ONYXKEYS.COLLECTION.REPORT, | ||
| waitForCollectionCallback: true, | ||
| callback: (value) => { | ||
|
|
@@ -1121,14 +1121,14 @@ | |
| }); | ||
|
|
||
| let betaConfiguration: OnyxEntry<BetaConfiguration> = {}; | ||
| Onyx.connect({ | ||
| key: ONYXKEYS.BETA_CONFIGURATION, | ||
| callback: (value) => (betaConfiguration = value ?? {}), | ||
| }); | ||
|
|
||
| let allTransactions: OnyxCollection<Transaction> = {}; | ||
| let reportsTransactions: Record<string, Transaction[]> = {}; | ||
| Onyx.connect({ | ||
| key: ONYXKEYS.COLLECTION.TRANSACTION, | ||
| waitForCollectionCallback: true, | ||
| callback: (value) => { | ||
|
|
@@ -1154,7 +1154,7 @@ | |
| }); | ||
|
|
||
| let allReportActions: OnyxCollection<ReportActions>; | ||
| Onyx.connect({ | ||
| key: ONYXKEYS.COLLECTION.REPORT_ACTIONS, | ||
| waitForCollectionCallback: true, | ||
| callback: (actions) => { | ||
|
|
@@ -9407,6 +9407,8 @@ | |
| includeDomainEmail?: boolean; | ||
| isReportArchived: boolean | undefined; | ||
| draftComment: string | undefined; | ||
| /** Pre-computed value from reportAttributes derived value. When provided, skips the expensive requiresAttentionFromCurrentUser recomputation. */ | ||
| requiresAttention?: boolean; | ||
| }; | ||
|
|
||
| function reasonForReportToBeInOptionList({ | ||
|
|
@@ -9422,6 +9424,7 @@ | |
| login, | ||
| includeDomainEmail = false, | ||
| isReportArchived, | ||
| requiresAttention, | ||
| }: ShouldReportBeInOptionListParams): ValueOf<typeof CONST.REPORT_IN_LHN_REASONS> | null { | ||
| const isInDefaultMode = !isInFocusMode; | ||
|
|
||
|
|
@@ -9502,7 +9505,7 @@ | |
| return CONST.REPORT_IN_LHN_REASONS.HAS_DRAFT_COMMENT; | ||
| } | ||
|
|
||
| if (requiresAttentionFromCurrentUser(report, undefined, isReportArchived)) { | ||
| if (requiresAttention ?? requiresAttentionFromCurrentUser(report, undefined, isReportArchived)) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Using Useful? React with 👍 / 👎.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm checking this
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually the problem is not in this file, but in @sobitneupane @shubham1206agra do you think I should modify
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sosek108 Can you put this in |
||
| return CONST.REPORT_IN_LHN_REASONS.HAS_GBR; | ||
| } | ||
|
|
||
|
|
||
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.
@sosek108 Can you make this a required parameter? This will help us remove null check from below. NAB but it's good to have.
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 want to have this optional as a fallback. And the check below is important so we know if we need to recompute this value.