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
Version Number: Reproducible in staging?: Needs Reproduction (Unable to reproduce) Reproducible in production?: Needs Reproduction If this was caught during regression testing, add the test name, ID and link from BrowserStack: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by:@OfstadC Slack conversation (hyperlinked to channel name): #Migrate
Action Performed:
Log in as the user in NewDot
Navigate to Home → For You
Compare visible reports with:
Classic Inbox, OR
Supportal data
Observe missing reports
Expected Result:
“For You” should:
Display all relevant reports assigned to the user
Match data shown in Classic Inbox and Supportal
Actual Result:
Some reports:
Appear in Supportal and Classic
Do not appear in “For You”
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
The "For You" section on the Home page is not a replacement for Classic Inbox — it is a narrowly scoped widget that only counts expense-type reports (report.type === 'expense') matching one of four specific action categories: Submit, Approve, Pay, or Export. Any report that is not an expense report (chats, IOUs, tasks, invoices) or any expense report where the current user is not in the required role (submitter, approver, payer, exporter) will never appear.
Submit: user must be submitter, report must be open, paid group policy, no scanning/pending transactions
Approve: user must be managerID, report must be processing, approval mode ≠ OPTIONAL
Pay: user must be payer, payments enabled, report must be approved/closed, must have reimbursable spend
Export: user must match policy.exporter exactly, connected integration must exist, report must be approved/reimbursed/closed
Classic Inbox shows all report types with any unread or actionable state. The mismatch is expected given this architecture — reports visible in Classic/Supportal but not in "For You" are likely non-expense reports, or expense reports where the user doesn't match the required action role, or expense reports in a state that doesn't match any of the four categories.
What changes do you think we should make in order to solve the problem?
This needs product clarification on what "For You" should contain. Two possible directions:
If "For You" should match Classic Inbox scope: The todos.ts derived config needs to be expanded beyond expense-type reports to include other report types (IOU, chat with GBR, tasks requiring action, etc.), and the ForYouSection UI would need additional widgets beyond Submit/Approve/Pay/Export.
If this is working as designed: The issue may be a user expectation mismatch during migration from Classic to NewDot. The LHN sidebar (Chat tab) is the actual equivalent of Classic Inbox for non-expense reports, and "For You" is intentionally limited to actionable expense workflows.
To confirm which reports are actually missing, we'd need the specific reportIDs from the Slack thread screenshots to check their report.type and state — this would clarify whether they're non-expense reports excluded by design or expense reports incorrectly filtered out.
What alternative solutions did you explore? (Optional)
There's also a secondary concern: the LHN sidebar itself uses SidebarUtils.shouldDisplayReportInLHN which has its own filtering. Reports with missing/undefined notificationPreference are treated as hidden (ReportUtils.ts:2221-2229), and Focus mode filters out all read non-GBR reports. If the missing reports aren't in the LHN either, these filters could be contributing.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
In the todos derived value, the loop early-skips every report whose type isn't expense. That filter is too narrow for the Pay action — isPrimaryPayAction is explicitly designed to also fire on IOU reports and invoice reports (see ReportPrimaryActionUtils.ts#L230-L247), but those reports never even reach the check because of the early continue.
CONST.REPORT.TYPE includes EXPENSE, IOU, INVOICE, TASK, CHAT (CONST/index.ts#L1681-L1687). Classic Inbox / Supportal include IOU and invoice reports that are awaiting payment by the current user, so they appear there but not in NewDot's "For You", which is exactly the mismatch in the report.
The downstream isSubmitAction/isApproveAction/isExportAction already restrict themselves to expense-only logic internally (and isExportAction even returns false for invoices at ReportPrimaryActionUtils.ts#L256-L260), so loosening the outer filter is safe — only Pay newly matches IOU/invoice, which is the intended behavior.
What changes do you think we should make in order to solve the problem?
Allow IOU and invoice reports through the outer guard so the Pay action can evaluate them:
for (const report of reports) {
- if (!report?.reportID || report.type !== CONST.REPORT.TYPE.EXPENSE) {+ if (+ !report?.reportID ||+ (report.type !== CONST.REPORT.TYPE.EXPENSE &&+ report.type !== CONST.REPORT.TYPE.IOU &&+ report.type !== CONST.REPORT.TYPE.INVOICE)+ ) {
continue;
}
While there, I'd also tighten the reportNameValuePairs lookup. For invoice/IOU reports, report.chatReportID may not point to a REPORT_NAME_VALUE_PAIRS entry the same way it does for expense reports, so we should fall back to the report's own ID:
This keeps the archived-report short-circuit in isPrimaryPayAction working for the newly-included types.
What alternative solutions did you explore? (Optional)
Replace the type check with isExpenseReport(report) || isIOUReport(report) || isInvoiceReport(report) using the existing ReportUtils helpers — equivalent semantics, slightly more idiomatic but a larger touch since each helper performs an extra null/type narrowing.
Drop the type filter entirely and rely on each action's internal checks. Functionally equivalent but iterates over every chat/task report, so a small perf regression on accounts with many chats — not worth it.
That early continue is too aggressive for the Pay bucket. isPrimaryPayAction is explicitly designed to fire for IOU and Invoice reports as well — see the IOU branch and Invoice branch:
Because IOU and Invoice reports never make it past the type guard in todos.ts, they are never pushed into reportsToPay. The For You "Pay" tile in ForYouSection reads its count from that exact bucket:
…so any IOU money request waiting on me to pay, or any invoice I owe as the receiver, silently disappears from "For You" while still appearing in Classic Inbox and Supportal — exactly the discrepancy @OfstadC reported.
The other three buckets (reportsToSubmit, reportsToApprove, reportsToExport) are unaffected because their respective predicates already short-circuit on non-expense reports internally (isExpenseReport checks inside isSubmitAction/isApproveAction, and isExportAction returns false for invoices).
What changes do you think we should make in order to solve the problem?
I'd loosen the type guard in createTodosReportsAndTransactions to also let IOU and Invoice reports through, since isPrimaryPayAction knows how to handle them and the other predicates self-filter:
for (const report of reports) {
- if (!report?.reportID || report.type !== CONST.REPORT.TYPE.EXPENSE) {+ if (+ !report?.reportID ||+ (report.type !== CONST.REPORT.TYPE.EXPENSE &&+ report.type !== CONST.REPORT.TYPE.IOU &&+ report.type !== CONST.REPORT.TYPE.INVOICE)+ ) {
continue;
}
With that change in place, the four predicate calls inside the loop already do the right thing:
isSubmitAction / isApproveAction return false for non-expense reports (they call isExpenseReportUtils early), so IOU/Invoice reports won't pollute the submit/approve buckets.
isExportAction returns false for invoice reports up top, and IOU reports don't have a connected integration / preferred exporter path — so the export bucket also stays clean.
isPrimaryPayAction will now correctly classify IOU "you owe" requests and Invoice receivables into reportsToPay.
No change is needed in ForYouSection/index.tsx or selectors/Todos.ts — they consume the bucket as-is.
I'd also extend tests/unit/OnyxDerivedTest.tsx / tests/unit/selectors/TodosTest.ts with two cases: (1) an IOU report where the current user is the payer with a positive reimbursableSpend, asserting it lands in reportsToPay; (2) an Invoice report where the current user is the individual invoiceReceiver, asserting the same. These are the two paths inside isPrimaryPayAction we are unlocking.
What alternative solutions did you explore? (Optional)
Drop the type check entirely. Cheap, but it lets chat and task reports walk through four predicate calls each just to be rejected. Wasteful on accounts with thousands of chats — Onyx-derived recomputation already shows up on perf traces — so I prefer the explicit allowlist above.
Add a separate second loop just for IOU/Invoice → Pay. Cleanly isolates the fix, but duplicates the policy/transaction/metadata lookup work for every report. Not worth the extra complexity when one extra condition in the existing guard does the job.
Move the type filter into isPrimaryPayAction itself. It already implicitly handles types correctly; the real problem is the caller over-filtering, so the fix belongs at the call site.
The "For You" counts come from the ONYXKEYS.DERIVED.TODOS derived value built in src/libs/actions/OnyxDerived/configs/todos.ts, consumed by src/pages/home/ForYouSection/index.tsx. Several filters there silently drop reports that Classic Inbox / Supportal still consider actionable.
Per-symptom file → function → line chains:
1. Pay-action reports for non-Expense report types are dropped entirely. createTodosReportsAndTransactions at src/libs/actions/OnyxDerived/configs/todos.ts:52-55 skips every report whose report.type !== CONST.REPORT.TYPE.EXPENSE. But isPrimaryPayAction in src/libs/ReportPrimaryActionUtils.ts:230-247 has explicit branches for IOU and Invoice reports (isIOUReport && isReportPayer && reimbursableSpend > 0, plus the invoice-receiver branch). Those branches can never run because the report was filtered out first → IOU/invoice reports needing payment never appear in the Pay count.
2. Export count drops admins and connection-level exporters. isExportAction at src/libs/ReportPrimaryActionUtils.ts:262-267 allows a report through when the user is admin OR isPreferredExporter(policy, login), where isPreferredExporter checks the connection-level exporter (policy.connections.{intacct,qbo,qbd,xero,netsuite}.config.export.exporter) — see src/libs/PolicyUtils.ts:2050-2099.
But todos.ts:81 re-filters with policy?.exporter === login, which is a different field (the policy-level exporter declared in src/types/onyx/Policy.ts:1883-1884). Result: admins who are not policy.exporter, and users who are the configured QBO/Xero/etc. exporter but not policy.exporter, get zero export todos despite seeing those reports in Classic.
3. Pay count silently drops "close-only" non-reimbursable reports. isPrimaryPayAction at src/libs/ReportPrimaryActionUtils.ts:216-223 deliberately returns true for finished reports where nonReimbursableSpend !== 0 && hasOnlyNonReimbursableTransactions(...). The outer call in todos.ts:67-79 then re-filters with && !hasOnlyNonReimbursableTransactions(report.reportID, reportTransactions), removing exactly those. Net effect: approved/closed reports made entirely of non-reimbursable transactions (the "mark as paid / close" action) never appear in Pay.
4. Scope mismatch with Classic Inbox.
For You only tracks four primary actions on expense reports: SUBMIT / APPROVE / PAY / EXPORT (counts produced by todosReportCountsSelector in src/selectors/Todos.ts:13-24). Classic Inbox surfaces a broader set: chats with mentions/replies, tasks, IOU reports, invoice rooms, holds, scan failures, reports waiting on the user's input, etc. None of those map to any For-You bucket today, so any user whose Classic Inbox contains non-action-bucketed items will permanently see "missing reports."
What changes do you think we should make in order to solve the problem?
The fix belongs in the derived-value layer (src/libs/actions/OnyxDerived/configs/todos.ts), not the render layer — that's where the wrong set is constructed and it's recomputed once per data change instead of per render.
Concretely:
Drop the report.type !== EXPENSE early-skip when evaluating Pay. Iterate all reports for Pay, but keep the Expense-only restriction for Submit/Approve/Export (those helpers already require Expense reports internally). For invoice/IOU reports isPrimaryPayAction already loads parentReport / invoiceReceiverPolicy it needs; pass those through (parent report is already accessible via Onyx, invoice-receiver policy via allPolicies).
Remove the second-layer policy?.exporter === login filter for export. isExportAction is the source of truth and already encodes admin/connection-exporter logic. If product wants policy.exporter as the gate, then isExportAction should be updated and the rest of the codebase aligned — duplicating an inconsistent check in only this one consumer is the bug.
Remove the second-layer !hasOnlyNonReimbursableTransactions filter for Pay. isPrimaryPayAction already encodes the desired condition; the outer filter inverts it.
For the scope mismatch: classify which Classic-Inbox items product wants in For You (mentions, holds, scan errors, IOU pay, invoices). Either expand the four buckets or add a "needs your attention" residual bucket fed by the existing OptionsListUtils/sidebar GBR/RBR pipeline (src/libs/SidebarUtils.ts) that already drives Classic-Inbox-equivalent counts. This is a product decision; flag it clearly in the issue rather than silently widening the four buckets.
Edge cases to weave in:
Loading: keep the isLoadingApp || isLoadingReportData || reportCounts === undefined guard in ForYouSection/index.tsx:127-134 so partially-loaded Onyx state shows the skeleton, not undercounts.
Optimistic add/remove: the derived value already recomputes on REPORT, TRANSACTION, REPORT_ACTIONS, etc. so optimistic creation and rollback flow through naturally. No extra plumbing.
Single-report navigation:todosSingleReportIDsSelector (src/selectors/Todos.ts:39-67) returns the single matching reportID per bucket. Once invoice/IOU reports start counting in Pay, deep-linking to a single invoice/IOU report needs to use the right route — the current handler in ForYouSection/index.tsx:42-64 always uses EXPENSE_REPORT_RHP / REPORT_WITH_ID; verify those work for invoice/IOU reports or branch on report.type.
What alternative solutions did you explore?
Fix in the render layer (ForYouSection/index.tsx). Rejected: render-layer would need to re-iterate the report collection on every render and also doesn't have access to the per-report inputs (reportTransactions, policy, bankAccountList) without re-deriving. It's also the wrong place — the bug is in what is counted, not how it's drawn.
Patch each isXAction helper to widen behavior. Rejected: those helpers are reused by other primary-action surfaces (header buttons, money-request page actions). Changing them would change UI semantics far beyond For You. The localized inconsistency is in todos.ts, so fix it there.
Add a Log.warn when a report is excluded so we can audit. Deferred: useful diagnostic, but not a fix.
Treat scope mismatch as out of scope for this PR. Deferred (not skipped) — symptoms 1–3 are concrete code defects with one-file fixes; symptom 4 needs product input on which Classic-Inbox concepts belong in For You. Recommend splitting symptom 4 into a separate ticket once the buckets are agreed, but keep symptoms 1–3 here.
⚠️@yusufdeveloper2903 Thanks for your proposal. Please update it to follow the proposal template, as proposals are only reviewed if they follow that format (note the mandatory sections).
The "For You" widget on Home is silently dropping reports that Classic Inbox / Supportal show as actionable. The root cause is in the derived value that powers the widget — src/libs/actions/OnyxDerived/configs/todos.ts — which filters out entire categories of actionable reports before the per-action checks ever run.
Root cause
There are several independent defects in createTodosReportsAndTransactions that each hide reports the user is genuinely expected to act on. Reproducing the mismatch with Classic/Supportal does not require special data — any account that is the receiver of an invoice, the payer on an IOU, or an admin/per-connection exporter on a policy whose top-level policy.exporter is someone else will be able to see it.
1 — The top-level type guard removes IOU and Invoice reports before the Pay check runs.
But isPrimaryPayAction (src/libs/ReportPrimaryActionUtils.ts:184-248) is explicitly written to handle three report types — Expense, IOU, and Invoice — and contains dedicated branches for each:
The report.type !== EXPENSE filter at line 53 short-circuits before any IOU or Invoice report can reach this code, so a user who owes a coworker money via IOU or who is the receiver of a workspace invoice will not see a "Pay 1 report" tile in "For You", even though Classic Inbox shows it and Supportal lists it as assigned.
2 — invoiceReceiverPolicy is never collected or passed to isPrimaryPayAction.
For the workspace-invoice "admin pays" path (line 247 above), the function needs the invoice receiver's policy. The hook that drives the in-report banner does pass it — src/hooks/useReportPrimaryAction.ts:26-28:
The value is then forwarded into isSubmitAction, which calls isArchivedReport(reportNameValuePairs) (line 114). Because the lookup pulls the chat's rNVP rather than the expense report's, an expense report whose chat happens to be archived (e.g. workspace chat archived after policy reassignment) will be incorrectly classified as "archived" and excluded from the Submit tile, while remaining visible and submittable from Classic Inbox.
4 — The Export filter has a redundant, over-restrictive policy.exporter === login check.
isExportAction (src/libs/ReportPrimaryActionUtils.ts:250-293) already encodes the eligibility rule: the user must be a per-connection preferred exporter (isPreferredExporter, which reads policy.connections.<integration>.config.export.exporter) or a policy admin. The extra && policy?.exporter === login clause checks the top-levelpolicy.exporter field instead, which is set by the policy creator and frequently does not equal the per-connection exporter or any admin login. Admins and connection-level exporters whose name is not in policy.exporter see the Export action on the report itself but get nothing on "For You".
Proposed fix
Apply the four changes below to src/libs/actions/OnyxDerived/configs/todos.ts. They are independent and each closes one of the gaps documented above.
// src/libs/actions/OnyxDerived/configs/todos.ts// (1) Replace the over-broad type guard with a per-action-type gate so IOU and// Invoice reports can reach the Pay branch.for(constreportofreports){if(!report?.reportID){continue;}constisExpense=report.type===CONST.REPORT.TYPE.EXPENSE;constisIOU=report.type===CONST.REPORT.TYPE.IOU;constisInvoice=report.type===CONST.REPORT.TYPE.INVOICE;if(!isExpense&&!isIOU&&!isInvoice){continue;}constpolicy=allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report.policyID}`];// (3) Key the rNVP by the report's own reportID, matching every other call site.constreportNameValuePair=allReportNameValuePairs?.[`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report.reportID}`];constreportActions=Object.values(allReportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report.reportID}`]??[]);constreportTransactions=transactionsByReportID[report.reportID]??[];constreportMetadata=allReportMetadata?.[`${ONYXKEYS.COLLECTION.REPORT_METADATA}${report.reportID}`];// (2) Resolve the invoice receiver policy for the workspace-invoice "admin pays" path.constchatReport=report.chatReportID ? allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${report.chatReportID}`] : undefined;constinvoiceReceiverPolicyID=chatReport?.invoiceReceiver&&'policyID'inchatReport.invoiceReceiver ? chatReport.invoiceReceiver.policyID : undefined;constinvoiceReceiverPolicy=invoiceReceiverPolicyID ? allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${invoiceReceiverPolicyID}`] : undefined;if(isExpense&&isSubmitAction(report,reportTransactions,reportMetadata,policy,reportNameValuePair,undefined,login,currentUserAccountID)){reportsToSubmit.push(report);}if(isExpense&&isApproveAction(report,reportTransactions,currentUserAccountID,reportMetadata,policy)){reportsToApprove.push(report);}if(isPrimaryPayAction({
report,
reportTransactions,
currentUserAccountID,currentUserLogin: login,
bankAccountList,
policy,reportNameValuePairs: reportNameValuePair,
invoiceReceiverPolicy,})&&!hasOnlyNonReimbursableTransactions(report.reportID,reportTransactions)){reportsToPay.push(report);}// (4) Trust isExportAction's own admin/per-connection rule; drop the redundant top-level check.if(isExpense&&isExportAction(report,login,policy,reportActions)){reportsToExport.push(report);}}
The dependency list at the bottom of the file already includes ONYXKEYS.COLLECTION.REPORT, so resolving chatReport from allReports requires no additional Onyx subscription.
Why this approach
Each change either restores parity with an existing call site (useReportPrimaryAction.ts for the rNVP key and the invoiceReceiverPolicy argument) or removes a duplicate gate that contradicts the helper's own contract (isPrimaryPayAction already discriminates on report type, and isExportAction already encodes admin-vs-exporter eligibility). The fix stays inside the derived-value layer and does not change the widget's UX contract — Submit/Approve continue to be expense-only, and Pay correctly grows to include the IOU and Invoice reports that the helper is already designed to evaluate. An alternative considered was to expand the four buckets into separate IOU/Invoice tiles, but that's a product/UX change; the bug here is that the existing Pay/Export buckets are missing reports they were already meant to count, so the conservative fix is to stop filtering them out. After this change, the per-report banner that useReportPrimaryAction renders and the count shown in "For You" are computed from the same inputs against the same helpers, eliminating the source of the Classic-Inbox / Supportal mismatch.
Activity
MelvinBot commentedon May 6, 2026
Proposal
What is the root cause of that problem?
The "For You" section on the Home page is not a replacement for Classic Inbox — it is a narrowly scoped widget that only counts expense-type reports (
report.type === 'expense') matching one of four specific action categories: Submit, Approve, Pay, or Export. Any report that is not an expense report (chats, IOUs, tasks, invoices) or any expense report where the current user is not in the required role (submitter, approver, payer, exporter) will never appear.The core filter is at
todos.ts:52-54:Each action category then applies additional strict filters in
ReportPrimaryActionUtils.ts:managerID, report must be processing, approval mode ≠ OPTIONALpolicy.exporterexactly, connected integration must exist, report must be approved/reimbursed/closedClassic Inbox shows all report types with any unread or actionable state. The mismatch is expected given this architecture — reports visible in Classic/Supportal but not in "For You" are likely non-expense reports, or expense reports where the user doesn't match the required action role, or expense reports in a state that doesn't match any of the four categories.
What changes do you think we should make in order to solve the problem?
This needs product clarification on what "For You" should contain. Two possible directions:
If "For You" should match Classic Inbox scope: The
todos.tsderived config needs to be expanded beyond expense-type reports to include other report types (IOU, chat with GBR, tasks requiring action, etc.), and the ForYouSection UI would need additional widgets beyond Submit/Approve/Pay/Export.If this is working as designed: The issue may be a user expectation mismatch during migration from Classic to NewDot. The LHN sidebar (Chat tab) is the actual equivalent of Classic Inbox for non-expense reports, and "For You" is intentionally limited to actionable expense workflows.
To confirm which reports are actually missing, we'd need the specific reportIDs from the Slack thread screenshots to check their
report.typeand state — this would clarify whether they're non-expense reports excluded by design or expense reports incorrectly filtered out.What alternative solutions did you explore? (Optional)
There's also a secondary concern: the LHN sidebar itself uses
SidebarUtils.shouldDisplayReportInLHNwhich has its own filtering. Reports with missing/undefinednotificationPreferenceare treated as hidden (ReportUtils.ts:2221-2229), and Focus mode filters out all read non-GBR reports. If the missing reports aren't in the LHN either, these filters could be contributing.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.yusufdeveloper2903 commentedon May 6, 2026
Proposal
What is the root cause of that problem?
In the
todosderived value, the loop early-skips every report whose type isn'texpense. That filter is too narrow for the Pay action —isPrimaryPayActionis explicitly designed to also fire on IOU reports and invoice reports (seeReportPrimaryActionUtils.ts#L230-L247), but those reports never even reach the check because of the earlycontinue.The offending guard is here:
src/libs/actions/OnyxDerived/configs/todos.ts#L52-L55CONST.REPORT.TYPEincludesEXPENSE,IOU,INVOICE,TASK,CHAT(CONST/index.ts#L1681-L1687). Classic Inbox / Supportal include IOU and invoice reports that are awaiting payment by the current user, so they appear there but not in NewDot's "For You", which is exactly the mismatch in the report.The downstream
isSubmitAction/isApproveAction/isExportActionalready restrict themselves to expense-only logic internally (andisExportActioneven returnsfalsefor invoices atReportPrimaryActionUtils.ts#L256-L260), so loosening the outer filter is safe — only Pay newly matches IOU/invoice, which is the intended behavior.What changes do you think we should make in order to solve the problem?
Allow IOU and invoice reports through the outer guard so the Pay action can evaluate them:
for (const report of reports) { - if (!report?.reportID || report.type !== CONST.REPORT.TYPE.EXPENSE) { + if ( + !report?.reportID || + (report.type !== CONST.REPORT.TYPE.EXPENSE && + report.type !== CONST.REPORT.TYPE.IOU && + report.type !== CONST.REPORT.TYPE.INVOICE) + ) { continue; }While there, I'd also tighten the
reportNameValuePairslookup. For invoice/IOU reports,report.chatReportIDmay not point to aREPORT_NAME_VALUE_PAIRSentry the same way it does for expense reports, so we should fall back to the report's own ID:This keeps the archived-report short-circuit in
isPrimaryPayActionworking for the newly-included types.What alternative solutions did you explore? (Optional)
isExpenseReport(report) || isIOUReport(report) || isInvoiceReport(report)using the existingReportUtilshelpers — equivalent semantics, slightly more idiomatic but a larger touch since each helper performs an extra null/type narrowing.David-2002065 commentedon May 6, 2026
Proposal
What is the root cause of that problem?
When the
todosderived value is built, the loop hard-filters every report that is not of typeEXPENSEbefore any of the per-action checks run:https://github.com/Expensify/App/blob/main/src/libs/actions/OnyxDerived/configs/todos.ts#L52-L55
That early
continueis too aggressive for the Pay bucket.isPrimaryPayActionis explicitly designed to fire for IOU and Invoice reports as well — see the IOU branch and Invoice branch:https://github.com/Expensify/App/blob/main/src/libs/ReportPrimaryActionUtils.ts#L230-L247
Because IOU and Invoice reports never make it past the type guard in
todos.ts, they are never pushed intoreportsToPay. The For You "Pay" tile inForYouSectionreads its count from that exact bucket:https://github.com/Expensify/App/blob/main/src/pages/home/ForYouSection/index.tsx#L37
…so any IOU money request waiting on me to pay, or any invoice I owe as the receiver, silently disappears from "For You" while still appearing in Classic Inbox and Supportal — exactly the discrepancy @OfstadC reported.
The other three buckets (
reportsToSubmit,reportsToApprove,reportsToExport) are unaffected because their respective predicates already short-circuit on non-expense reports internally (isExpenseReportchecks insideisSubmitAction/isApproveAction, andisExportActionreturnsfalsefor invoices).What changes do you think we should make in order to solve the problem?
I'd loosen the type guard in
createTodosReportsAndTransactionsto also let IOU and Invoice reports through, sinceisPrimaryPayActionknows how to handle them and the other predicates self-filter:for (const report of reports) { - if (!report?.reportID || report.type !== CONST.REPORT.TYPE.EXPENSE) { + if ( + !report?.reportID || + (report.type !== CONST.REPORT.TYPE.EXPENSE && + report.type !== CONST.REPORT.TYPE.IOU && + report.type !== CONST.REPORT.TYPE.INVOICE) + ) { continue; }With that change in place, the four predicate calls inside the loop already do the right thing:
isSubmitAction/isApproveActionreturnfalsefor non-expense reports (they callisExpenseReportUtilsearly), so IOU/Invoice reports won't pollute the submit/approve buckets.isExportActionreturnsfalsefor invoice reports up top, and IOU reports don't have a connected integration / preferred exporter path — so the export bucket also stays clean.isPrimaryPayActionwill now correctly classify IOU "you owe" requests and Invoice receivables intoreportsToPay.No change is needed in
ForYouSection/index.tsxorselectors/Todos.ts— they consume the bucket as-is.I'd also extend
tests/unit/OnyxDerivedTest.tsx/tests/unit/selectors/TodosTest.tswith two cases: (1) an IOU report where the current user is the payer with a positivereimbursableSpend, asserting it lands inreportsToPay; (2) an Invoice report where the current user is the individualinvoiceReceiver, asserting the same. These are the two paths insideisPrimaryPayActionwe are unlocking.What alternative solutions did you explore? (Optional)
chatandtaskreports walk through four predicate calls each just to be rejected. Wasteful on accounts with thousands of chats — Onyx-derived recomputation already shows up on perf traces — so I prefer the explicit allowlist above.isPrimaryPayActionitself. It already implicitly handles types correctly; the real problem is the caller over-filtering, so the fix belongs at the call site.melvin-bot commentedon May 6, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @huult (
External)oqildev commentedon May 6, 2026
Proposal
What is the root cause of that problem?
The "For You" counts come from the
ONYXKEYS.DERIVED.TODOSderived value built insrc/libs/actions/OnyxDerived/configs/todos.ts, consumed bysrc/pages/home/ForYouSection/index.tsx. Several filters there silently drop reports that Classic Inbox / Supportal still consider actionable.Per-symptom file → function → line chains:
1. Pay-action reports for non-Expense report types are dropped entirely.
createTodosReportsAndTransactionsatsrc/libs/actions/OnyxDerived/configs/todos.ts:52-55skips every report whosereport.type !== CONST.REPORT.TYPE.EXPENSE. ButisPrimaryPayActioninsrc/libs/ReportPrimaryActionUtils.ts:230-247has explicit branches for IOU and Invoice reports (isIOUReport && isReportPayer && reimbursableSpend > 0, plus the invoice-receiver branch). Those branches can never run because the report was filtered out first → IOU/invoice reports needing payment never appear in the Pay count.2. Export count drops admins and connection-level exporters.
isExportActionatsrc/libs/ReportPrimaryActionUtils.ts:262-267allows a report through when the user is admin ORisPreferredExporter(policy, login), whereisPreferredExporterchecks the connection-level exporter (policy.connections.{intacct,qbo,qbd,xero,netsuite}.config.export.exporter) — seesrc/libs/PolicyUtils.ts:2050-2099.But
todos.ts:81re-filters withpolicy?.exporter === login, which is a different field (the policy-level exporter declared insrc/types/onyx/Policy.ts:1883-1884). Result: admins who are not policy.exporter, and users who are the configured QBO/Xero/etc. exporter but not policy.exporter, get zero export todos despite seeing those reports in Classic.3. Pay count silently drops "close-only" non-reimbursable reports.
isPrimaryPayActionatsrc/libs/ReportPrimaryActionUtils.ts:216-223deliberately returnstruefor finished reports wherenonReimbursableSpend !== 0 && hasOnlyNonReimbursableTransactions(...). The outer call intodos.ts:67-79then re-filters with&& !hasOnlyNonReimbursableTransactions(report.reportID, reportTransactions), removing exactly those. Net effect: approved/closed reports made entirely of non-reimbursable transactions (the "mark as paid / close" action) never appear in Pay.4. Scope mismatch with Classic Inbox.
For You only tracks four primary actions on expense reports: SUBMIT / APPROVE / PAY / EXPORT (counts produced by
todosReportCountsSelectorinsrc/selectors/Todos.ts:13-24). Classic Inbox surfaces a broader set: chats with mentions/replies, tasks, IOU reports, invoice rooms, holds, scan failures, reports waiting on the user's input, etc. None of those map to any For-You bucket today, so any user whose Classic Inbox contains non-action-bucketed items will permanently see "missing reports."What changes do you think we should make in order to solve the problem?
The fix belongs in the derived-value layer (
src/libs/actions/OnyxDerived/configs/todos.ts), not the render layer — that's where the wrong set is constructed and it's recomputed once per data change instead of per render.Concretely:
report.type !== EXPENSEearly-skip when evaluating Pay. Iterate all reports for Pay, but keep the Expense-only restriction for Submit/Approve/Export (those helpers already require Expense reports internally). For invoice/IOU reportsisPrimaryPayActionalready loadsparentReport/invoiceReceiverPolicyit needs; pass those through (parent report is already accessible via Onyx, invoice-receiver policy viaallPolicies).policy?.exporter === loginfilter for export.isExportActionis the source of truth and already encodes admin/connection-exporter logic. If product wants policy.exporter as the gate, thenisExportActionshould be updated and the rest of the codebase aligned — duplicating an inconsistent check in only this one consumer is the bug.!hasOnlyNonReimbursableTransactionsfilter for Pay.isPrimaryPayActionalready encodes the desired condition; the outer filter inverts it.OptionsListUtils/sidebar GBR/RBR pipeline (src/libs/SidebarUtils.ts) that already drives Classic-Inbox-equivalent counts. This is a product decision; flag it clearly in the issue rather than silently widening the four buckets.Edge cases to weave in:
isLoadingApp || isLoadingReportData || reportCounts === undefinedguard inForYouSection/index.tsx:127-134so partially-loaded Onyx state shows the skeleton, not undercounts.REPORT,TRANSACTION,REPORT_ACTIONS, etc. so optimistic creation and rollback flow through naturally. No extra plumbing.todosSingleReportIDsSelector(src/selectors/Todos.ts:39-67) returns the single matching reportID per bucket. Once invoice/IOU reports start counting in Pay, deep-linking to a single invoice/IOU report needs to use the right route — the current handler inForYouSection/index.tsx:42-64always usesEXPENSE_REPORT_RHP/REPORT_WITH_ID; verify those work for invoice/IOU reports or branch onreport.type.What alternative solutions did you explore?
ForYouSection/index.tsx). Rejected: render-layer would need to re-iterate the report collection on every render and also doesn't have access to the per-report inputs (reportTransactions,policy,bankAccountList) without re-deriving. It's also the wrong place — the bug is in what is counted, not how it's drawn.isXActionhelper to widen behavior. Rejected: those helpers are reused by other primary-action surfaces (header buttons, money-request page actions). Changing them would change UI semantics far beyond For You. The localized inconsistency is intodos.ts, so fix it there.Log.warnwhen a report is excluded so we can audit. Deferred: useful diagnostic, but not a fix.[-]“For You” Section Missing Classic Inbox Reports (Mismatch with Supportal)[/-][+][$250] “For You” Section Missing Classic Inbox Reports (Mismatch with Supportal)[/+]melvin-bot commentedon May 6, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022052115396703942764
github-actions commentedon May 6, 2026
trasnake87 commentedon May 6, 2026
Proposal
The "For You" widget on Home is silently dropping reports that Classic Inbox / Supportal show as actionable. The root cause is in the derived value that powers the widget —
src/libs/actions/OnyxDerived/configs/todos.ts— which filters out entire categories of actionable reports before the per-action checks ever run.Root cause
There are several independent defects in
createTodosReportsAndTransactionsthat each hide reports the user is genuinely expected to act on. Reproducing the mismatch with Classic/Supportal does not require special data — any account that is the receiver of an invoice, the payer on an IOU, or an admin/per-connection exporter on a policy whose top-levelpolicy.exporteris someone else will be able to see it.1 — The top-level type guard removes IOU and Invoice reports before the Pay check runs.
src/libs/actions/OnyxDerived/configs/todos.ts:52-55:But
isPrimaryPayAction(src/libs/ReportPrimaryActionUtils.ts:184-248) is explicitly written to handle three report types — Expense, IOU, and Invoice — and contains dedicated branches for each:The
report.type !== EXPENSEfilter at line 53 short-circuits before any IOU or Invoice report can reach this code, so a user who owes a coworker money via IOU or who is the receiver of a workspace invoice will not see a "Pay 1 report" tile in "For You", even though Classic Inbox shows it and Supportal lists it as assigned.2 —
invoiceReceiverPolicyis never collected or passed toisPrimaryPayAction.For the workspace-invoice "admin pays" path (line 247 above), the function needs the invoice receiver's policy. The hook that drives the in-report banner does pass it —
src/hooks/useReportPrimaryAction.ts:26-28:todos.tsneither resolves the parent chat nor reads the receiver policy, so even after fixing (1), workspace-invoice admins would still be missed.3 —
reportNameValuePairsis looked up under the wrong key.src/libs/actions/OnyxDerived/configs/todos.ts:57:Every other call site keys the rNVP by the money report's own
reportID:src/hooks/useReportPrimaryAction.ts:24—${...REPORT_NAME_VALUE_PAIRS}${getNonEmptyStringOnyxID(moneyRequestReport?.reportID)}src/libs/actions/OnyxDerived/configs/reportAttributes.ts:258—${...REPORT_NAME_VALUE_PAIRS}${report.reportID}src/libs/ReportUtils.ts:11528—${...REPORT_NAME_VALUE_PAIRS}${iouReport.reportID}The value is then forwarded into
isSubmitAction, which callsisArchivedReport(reportNameValuePairs)(line 114). Because the lookup pulls the chat's rNVP rather than the expense report's, an expense report whose chat happens to be archived (e.g. workspace chat archived after policy reassignment) will be incorrectly classified as "archived" and excluded from the Submit tile, while remaining visible and submittable from Classic Inbox.4 — The Export filter has a redundant, over-restrictive
policy.exporter === logincheck.src/libs/actions/OnyxDerived/configs/todos.ts:81:isExportAction(src/libs/ReportPrimaryActionUtils.ts:250-293) already encodes the eligibility rule: the user must be a per-connection preferred exporter (isPreferredExporter, which readspolicy.connections.<integration>.config.export.exporter) or a policy admin. The extra&& policy?.exporter === loginclause checks the top-levelpolicy.exporterfield instead, which is set by the policy creator and frequently does not equal the per-connection exporter or any admin login. Admins and connection-level exporters whose name is not inpolicy.exportersee the Export action on the report itself but get nothing on "For You".Proposed fix
Apply the four changes below to
src/libs/actions/OnyxDerived/configs/todos.ts. They are independent and each closes one of the gaps documented above.The dependency list at the bottom of the file already includes
ONYXKEYS.COLLECTION.REPORT, so resolvingchatReportfromallReportsrequires no additional Onyx subscription.Why this approach
Each change either restores parity with an existing call site (
useReportPrimaryAction.tsfor the rNVP key and theinvoiceReceiverPolicyargument) or removes a duplicate gate that contradicts the helper's own contract (isPrimaryPayActionalready discriminates on report type, andisExportActionalready encodes admin-vs-exporter eligibility). The fix stays inside the derived-value layer and does not change the widget's UX contract — Submit/Approve continue to be expense-only, and Pay correctly grows to include the IOU and Invoice reports that the helper is already designed to evaluate. An alternative considered was to expand the four buckets into separate IOU/Invoice tiles, but that's a product/UX change; the bug here is that the existing Pay/Export buckets are missing reports they were already meant to count, so the conservative fix is to stop filtering them out. After this change, the per-report banner thatuseReportPrimaryActionrenders and the count shown in "For You" are computed from the same inputs against the same helpers, eliminating the source of the Classic-Inbox / Supportal mismatch.mountiny commentedon May 6, 2026
Based on logs analysis the OpenApp was never triggered which seems to be the same issue as #89745 fixed