You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-08-05] [$250] Expense - Error flashes when opening the Attendees field #97163
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
Classification: Frontend bug Causing PR: #96440 - "Migrate useSearchSelector.base.ts from useOptionsList to usePersonalDetailOptions (part 6)" by @shubham1206agra (High confidence) Related Issues: None
Recommendation: REVERT
PR #96440 changed MoneyRequestAttendeeSelector to a hook where selectedOptions is derived from asynchronously-loaded options instead of being seeded synchronously, so the "at least one attendee" error renders during the brief window before options finish loading. A clean revert of the App PR removes the flash; a targeted fix is also viable (see Root Cause) if the reviewers prefer to roll forward.
Assigned: @shubham1206agra (PR author), @hoangzinh and @mountiny (approving reviewers) from PR #96440 Labels: No changes. The issue carries only DeployBlockerCash; an App PR caused the regression, so the App deploy stays blocked. No DeployBlocker (Web) label is present to remove.
📋 Detailed Analysis
Evidence
The flashing string "At least one attendee must be selected" (iou.error.atLeastOneAttendee) is rendered by src/pages/iou/request/MoneyRequestAttendeeSelector.tsx:153, gated by shouldShowErrorMessage = selectedOptions.length < 1 at line 130.
Reproducible on staging only, not production → a new regression introduced by a PR in the 9.4.45 deploy.
initialSelected was the full array of attendee option objects, so on first render selectedOptions.length >= 1 immediately — no error could flash, even before options loaded.
After #96440, the selector uses usePersonalDetailSearchSelector, whose base.ts derives selectedOptions from loaded data:
constareOptionsInitialized=(optionsWithContacts?.length??0)>0;
...
consttransformedOptions=optionsWithContacts?.map(o=>({...o,isSelected: selectedAccountIDs.has(o.accountID.toString())}))??[];constselectedOptions=/* from transformedOptions.isSelected + extraOptions.isSelected */;
The selector now passes initialSelected as a Set of accountID strings, and only seeds initialExtraOptions for attendees that are not in personal details (.filter((option) => !option.personalDetail) in MoneyRequestAttendeeSelector.tsx).
For the repro's default attendee (the report owner / current user, who is in personal details), the attendee lives only in the initialSelected accountID Set — not in extraOptions. Until usePersonalDetailOptions finishes loading, optionsWithContacts is empty → transformedOptions is empty → selectedOptions is empty → shouldShowErrorMessage is true → the red error renders. Once options initialize, the accountID matches, selectedOptions populates, and the error disappears — producing the brief flash on open.
Note that shouldShowErrorMessage (line 130) is not gated by areOptionsInitialized, while the list/sections are (lines 173, 230). A targeted roll-forward fix would gate the footer error the same way, e.g. only compute the error once options are ready:
Root Cause: A red iou.error.atLeastOneAttendee error flashes because the footer error is gated only by selectedOptions.length < 1 in MoneyRequestAttendeeSelector.tsx:129 — it is not gated by areOptionsInitialized the way the option list is. After PR #96440 migrated this selector to usePersonalDetailSearchSelector, selectedOptions is now derived asynchronously from optionsWithContacts (loaded by usePersonalDetailOptions). The default attendee (the current user, who exists in personal details) lives only in the selectedAccountIDs Set, so until options finish loading transformedOptions is empty → selectedOptions is empty → the error renders, then clears once options initialize. This is a staging-only regression (not reproducible in production), consistent with a PR in the current 9.4.45 StagingDeployCash.
This suppresses the error while options are still loading, so it only appears once the user has genuinely deselected all attendees. Reverting #96440 is the alternative if a targeted roll-forward isn't preferred for the deploy.
Investigation details
Symptom: With Rules + Attendee tracking enabled, opening the Attendees field on an expense that already has the default attendee briefly flashes "At least one attendee is required."
Before: the old useSearchSelector seeded selectedOptions synchronously from the full attendee option objects, so selectedOptions.length >= 1 on the very first render — no flash was possible.
After [Payment due @hoangzinh] Migrate useSearchSelector.base.ts from useOptionsList to usePersonalDetailOptions (part 6) #96440:selectedOptions is computed from transformedOptions (derived from the async optionsWithContacts) plus extraOptions. The selector only seeds initialExtraOptions for attendees not in personal details (.filter((option) => !option.personalDetail)). The repro's default attendee is the report owner / current user, who is in personal details, so it lives only in the accountID Set — invisible until optionsWithContacts loads. During that window selectedOptions is empty and the error renders.
Alternative explanations considered: A pure validation-timing bug independent of #96440 was ruled out — the error path itself is unchanged; only the source/timing of selectedOptions changed, and that change is exactly what #96440 introduced. "Not reproducible in production" further confirms it's a regression from a PR in this deploy rather than long-standing behavior.
Confidence: High — code evidence explains all symptoms and the before/after diff of #96440 accounts for both the appearance and the flash-then-clear timing.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/97163) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
Ran locally against the change: Oxfmt, ESLint, typecheck-tsgo, and the React Compiler compliance check all pass. There's no component-specific Jest test for this selector, so the human co-author should add the manual Tests/QA steps before marking the PR ready.
Please mark it as "Ready for review" when it is ready.
changed the title [-]Expense - Error flashes when opening the Attendees field[/-][+][$250] Expense - Error flashes when opening the Attendees field[/+]on Jul 28, 2026
changed the title [-][$250] Expense - Error flashes when opening the Attendees field[/-][+][Due for payment 2026-08-05] [$250] Expense - Error flashes when opening the Attendees field[/+]on Jul 29, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.45-14 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-08-05. 🎊
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]
Activity
applause-bot commentedon Jul 27, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/0dfc17cf61ddcad1858e2050f1b7c934e488a7be0945f194891ef6e28f73c2e0
melvin-bot commentedon Jul 27, 2026
Triggered auto assignment to @stitesExpensify (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.melvin-bot commentedon Jul 27, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Jul 27, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
MelvinBot commentedon Jul 27, 2026
🔍 Investigation Summary
Classification: Frontend bug
Causing PR: #96440 - "Migrate useSearchSelector.base.ts from useOptionsList to usePersonalDetailOptions (part 6)" by @shubham1206agra (High confidence)
Related Issues: None
Recommendation: REVERT
PR #96440 changed
MoneyRequestAttendeeSelectorto a hook whereselectedOptionsis derived from asynchronously-loaded options instead of being seeded synchronously, so the "at least one attendee" error renders during the brief window before options finish loading. A clean revert of the App PR removes the flash; a targeted fix is also viable (see Root Cause) if the reviewers prefer to roll forward.Assigned: @shubham1206agra (PR author), @hoangzinh and @mountiny (approving reviewers) from PR #96440
Labels: No changes. The issue carries only
DeployBlockerCash; an App PR caused the regression, so the App deploy stays blocked. NoDeployBlocker(Web) label is present to remove.📋 Detailed Analysis
Evidence
"At least one attendee must be selected"(iou.error.atLeastOneAttendee) is rendered bysrc/pages/iou/request/MoneyRequestAttendeeSelector.tsx:153, gated byshouldShowErrorMessage = selectedOptions.length < 1at line 130.2026-07-24, within this deploy window. It directly rewritesMoneyRequestAttendeeSelector.tsxandsrc/hooks/usePersonalDetailSearchSelector/base.ts— the exact files that produceselectedOptions.Verification
src/pages/iou/request/MoneyRequestAttendeeSelector.tsx(error render +shouldShowErrorMessage) andsrc/hooks/usePersonalDetailSearchSelector/base.ts(derivation ofselectedOptions/areOptionsInitialized).9.4.44-6...main) shows both files changed in this release, andgh pr view 96440 --json filesconfirms PR [Payment due @hoangzinh] Migrate useSearchSelector.base.ts from useOptionsList to usePersonalDetailOptions (part 6) #96440 modifies both.Root Cause
Before #96440, the selector used
useSearchSelector, whosebase.tsinitialized selection synchronously:initialSelectedwas the full array of attendee option objects, so on first renderselectedOptions.length >= 1immediately — no error could flash, even before options loaded.After #96440, the selector uses
usePersonalDetailSearchSelector, whosebase.tsderivesselectedOptionsfrom loaded data:The selector now passes
initialSelectedas aSetof accountID strings, and only seedsinitialExtraOptionsfor attendees that are not in personal details (.filter((option) => !option.personalDetail)inMoneyRequestAttendeeSelector.tsx).For the repro's default attendee (the report owner / current user, who is in personal details), the attendee lives only in the
initialSelectedaccountID Set — not inextraOptions. UntilusePersonalDetailOptionsfinishes loading,optionsWithContactsis empty →transformedOptionsis empty →selectedOptionsis empty →shouldShowErrorMessageis true → the red error renders. Once options initialize, the accountID matches,selectedOptionspopulates, and the error disappears — producing the brief flash on open.Note that
shouldShowErrorMessage(line 130) is not gated byareOptionsInitialized, while the list/sections are (lines 173, 230). A targeted roll-forward fix would gate the footer error the same way, e.g. only compute the error once options are ready:This keeps the migration and eliminates the flash without a full revert.
MelvinBot commentedon Jul 27, 2026
Issue Analysis
Root Cause: A red
iou.error.atLeastOneAttendeeerror flashes because the footer error is gated only byselectedOptions.length < 1inMoneyRequestAttendeeSelector.tsx:129— it is not gated byareOptionsInitializedthe way the option list is. After PR #96440 migrated this selector tousePersonalDetailSearchSelector,selectedOptionsis now derived asynchronously fromoptionsWithContacts(loaded byusePersonalDetailOptions). The default attendee (the current user, who exists in personal details) lives only in theselectedAccountIDsSet, so until options finish loadingtransformedOptionsis empty →selectedOptionsis empty → the error renders, then clears once options initialize. This is a staging-only regression (not reproducible in production), consistent with a PR in the current 9.4.45 StagingDeployCash.Recommended Fix: Gate the footer error the same way the option list is already gated, in
MoneyRequestAttendeeSelector.tsx:129:This suppresses the error while options are still loading, so it only appears once the user has genuinely deselected all attendees. Reverting #96440 is the alternative if a targeted roll-forward isn't preferred for the deploy.
Investigation details
Symptom: With Rules + Attendee tracking enabled, opening the Attendees field on an expense that already has the default attendee briefly flashes "At least one attendee is required."
Why it flashes now but didn't before #96440:
useSearchSelectorseededselectedOptionssynchronously from the full attendee option objects, soselectedOptions.length >= 1on the very first render — no flash was possible.selectedOptionsis computed fromtransformedOptions(derived from the asyncoptionsWithContacts) plusextraOptions. The selector only seedsinitialExtraOptionsfor attendees not in personal details (.filter((option) => !option.personalDetail)). The repro's default attendee is the report owner / current user, who is in personal details, so it lives only in the accountID Set — invisible untiloptionsWithContactsloads. During that windowselectedOptionsis empty and the error renders.Evidence:
MoneyRequestAttendeeSelector.tsx:129and theFormHelpMessagerender ingetFooterContentjust below it.selectedOptionsandareOptionsInitialized:usePersonalDetailSearchSelector/base.ts:185-213.Alternative explanations considered: A pure validation-timing bug independent of #96440 was ruled out — the error path itself is unchanged; only the source/timing of
selectedOptionschanged, and that change is exactly what #96440 introduced. "Not reproducible in production" further confirms it's a regression from a PR in this deploy rather than long-standing behavior.Confidence: High — code evidence explains all symptoms and the before/after diff of #96440 accounts for both the appearance and the flash-then-clear timing.
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/97163)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
shubham1206agra commentedon Jul 28, 2026
@MelvinBot Implement #97163 (comment)
MelvinBot commentedon Jul 28, 2026
🤖 Draft PR created: #97176
Implemented the approved fix by gating the footer error on
areOptionsInitialized, so it no longer flashes while options are still loading:Ran locally against the change: Oxfmt, ESLint,
typecheck-tsgo, and the React Compiler compliance check all pass. There's no component-specific Jest test for this selector, so the human co-author should add the manualTests/QAsteps before marking the PR ready.Please mark it as "Ready for review" when it is ready.
melvin-bot commentedon Jul 28, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022081950425536084141
[-]Expense - Error flashes when opening the Attendees field[/-][+][$250] Expense - Error flashes when opening the Attendees field[/+]m-natarajan commentedon Jul 29, 2026
Issue no longer reproducible on Build 9.4.45-14. Retested on Windows11/Chrome.
No.Error.mp4
[-][$250] Expense - Error flashes when opening the Attendees field[/-][+][Due for payment 2026-08-05] [$250] Expense - Error flashes when opening the Attendees field[/+]melvin-bot commentedon Jul 29, 2026
@hoangzinh / @shubham1206agra
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.45-14 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-08-05. 🎊
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]