🍒 Cherry pick PR #95233 to staging 🍒#95234
Conversation
Removes the loginToAccountIDMap derived Onyx key and restores the pre-94784 Attendee type/shape. Resolves conflicts with #94299 by keeping the flaggedExpenses hook migration. Co-authored-by: Cursor <cursoragent@cursor.com> (cherry picked from commit d877b2c) (cherry-picked to staging by mountiny) Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 56ec162ddd
ℹ️ 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".
| reportID: CONST.DEFAULT_NUMBER_ID.toString(), | ||
| // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing | ||
| keyForList: attendee.email || attendee.displayName, | ||
| keyForList: String(attendee.accountID) || attendee.email || attendee.displayName, |
There was a problem hiding this comment.
Preserve fallback keys for attendees without account IDs
When editing attendees saved in the restored pre-94784 shape, accountID is often absent; String(undefined) is still the truthy string "undefined", so every such initial attendee gets the same keyForList instead of falling back to email/displayName. The attendee picker uses this value as the list key, which can produce duplicate rows/incorrect rendering or toggling when multiple existing/name-only attendees are opened for editing.
Useful? React with 👍 / 👎.
| if (ownerAccountID !== undefined) { | ||
| // Normal case: filter by accountID | ||
| attendeesMinusOwnerCount = attendees.filter((a) => a?.accountID !== ownerAccountID).length; |
There was a problem hiding this comment.
Fall back when attendee account IDs are missing
For existing/backend attendee objects that only have email/login (the restored attendee shape makes accountID optional), this branch runs whenever the expense report has an ownerAccountID and counts undefined !== ownerAccountID as a non-owner attendee. As a result, a required-attendees expense whose only attendee is the report owner can incorrectly clear missingAttendees until the attendee is re-saved with an account ID; fall back to login/email when an attendee lacks accountID.
Useful? React with 👍 / 👎.
🍒 Cherry pick #95233 to staging 🍒
Reverts PR #94784 on staging to resolve DeployBlocker Expensify/Expensify#655280 (
LogAPI - Massive log message givenfromloginToAccountIDMapOnyx logging).Explanation of Change
Same as #95233 — removes
loginToAccountIDMapderived Onyx key and restores pre-94784 Attendee type/shape.Fixed Issues
$ https://github.com/Expensify/Expensify/issues/655280
Tests
LogAPI - Massive log message givenalerts from[Onyx] set called for key: loginToAccountIDMap.Offline tests
Same as Tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, 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.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