Part 3 - Thread personalDetailsList through hasExpensifyGuidesEmails and currentUserLogin through isJoinRequestInAdminRoom - #95329
Conversation
…s checks Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e81a05fc27
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…int failures Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
… fallback Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@codex review |
|
@MelvinBot review |
ReviewSolid, well-scoped Part 3. The migration threads 1. Perf:
|
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@MelvinBot I have made the changes, please review again! |
Re-review — all feedback addressed ✅Thanks, the four points from my last review are all resolved and the changes are behavior-preserving:
No further concerns from me. LGTM pending CI (typecheck/tests) staying green. |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@DylanDylann 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] |
|
PR doesn’t need product input as a refactor PR. Unassigning and unsubscribing myself. |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Keep upstream onboarding/deeplink guards in Link.ts while preserving PR 3 findLastAccessedReport signature. Use derived reportID in withReportOrNotFound openReport call. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@DylanDylann friendly bump |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
…onflict Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@DylanDylann friendly bump |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
| import ONYXKEYS from '@src/ONYXKEYS'; | ||
| import type * as OnyxTypes from '@src/types/onyx'; | ||
|
|
||
| import type {OnyxEntry} from 'react-native-onyx'; |
| const guidesEmailsByReportSelector = useCallback( | ||
| (personalDetailsList: OnyxEntry<OnyxTypes.PersonalDetailsList>) => computeGuidesEmailsByReport(personalDetailsList), | ||
| [computeGuidesEmailsByReport], | ||
| ); |
There was a problem hiding this comment.
Please move the selector to delector folder
There was a problem hiding this comment.
It’s already in src/selectors/PersonalDetails.ts as createGuidesEmailsByReportSelector. The hook only memos that factory for useOnyx.
| const computeGuidesEmailsByReport = useMemo(() => createGuidesEmailsByReportSelector(chatReports), [chatReports]); | ||
| const guidesEmailsByReportSelector = useCallback( | ||
| (personalDetailsList: OnyxEntry<OnyxTypes.PersonalDetailsList>) => computeGuidesEmailsByReport(personalDetailsList), | ||
| [computeGuidesEmailsByReport], | ||
| ); |
There was a problem hiding this comment.
Could you make it cleaner
There was a problem hiding this comment.
Done — dropped the extra useCallback and kept a single useMemo(() => createGuidesEmailsByReportSelector(chatReports), [chatReports]).
| } | ||
|
|
||
| cachedParticipantLoginsKey = participantLoginsKey; | ||
| const map: Record<string, boolean> = {}; |
There was a problem hiding this comment.
@MelvinBot Should we return a Map from the selector?
There was a problem hiding this comment.
No — I'd keep returning the plain Record<string, boolean> here.
Why
- Consistency: the sibling selector in this same file,
createDisplayDetailsByAccountIDsSelector, also returns a plainRecord. AMapwould be the odd one out. - A
Mapwould break existing consumers:useSidebarOrderedReports.tsx:115doesJSON.stringify(guidesEmailsByReport ?? {})for change detection.JSON.stringifyof aMapis always"{}", so that comparison would silently stop detecting changes.ReportUtils.ts:2425-2426usesreportID in guidesEmailsByReportandguidesEmailsByReport[reportID], which would have to become.has()/.get().
- Keys are string reportIDs, so a plain object is the natural fit — a
Mapbuys nothing here (no non-string keys, no ordering or.sizeneeds).
A Map would only be worth the churn if you needed non-string keys, guaranteed iteration order, or frequent size checks — none of which apply.
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@DylanDylann ready for review |
Explanation of Change
Fixed Issues
$ #66413
PROPOSAL:
Tests
Offline tests
QA Steps
Same as tests
Verify that no errors appear in the JS console
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Monosnap.screencast.2026-07-06.01-56-08.mp4