Skip to content

[$250] “For You” Section Missing Classic Inbox Reports (Mismatch with Supportal) #89807

Closed

Description

@m-natarajan

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


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:

  1. Log in as the user in NewDot
  2. Navigate to Home → For You
  3. Compare visible reports with:
  4. Classic Inbox, OR
  5. Supportal data
  6. 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:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

The screenshots for the issue are in Slack thread

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022052115396703942764
  • Upwork Job ID: 2052115396703942764
  • Last Price Increase: 2026-05-06

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on May 6, 2026
  2. MelvinBot commented on May 6, 2026

    @MelvinBot
    Contributor

    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:

    if (!report?.reportID || report.type !== CONST.REPORT.TYPE.EXPENSE) {
        continue;
    }

    Each action category then applies additional strict filters in ReportPrimaryActionUtils.ts:

    • 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:

    1. 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.

    2. 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.

  3. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on May 6, 2026
  4. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on May 6, 2026
  5. yusufdeveloper2903 commented on May 6, 2026

    @yusufdeveloper2903
    Contributor

    Proposal

    What is the root cause of that problem?

    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.

    The offending guard is here:

    src/libs/actions/OnyxDerived/configs/todos.ts#L52-L55

    for (const report of reports) {
        if (!report?.reportID || report.type !== CONST.REPORT.TYPE.EXPENSE) {
            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:

    -const reportNameValuePair = allReportNameValuePairs?.[`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report.chatReportID}`];
    +const reportNameValuePair =
    +    allReportNameValuePairs?.[`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report.chatReportID}`] ??
    +    allReportNameValuePairs?.[`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report.reportID}`];

    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.
  6. David-2002065 commented on May 6, 2026

    @David-2002065
    Contributor

    Proposal

    What is the root cause of that problem?

    When the todos derived value is built, the loop hard-filters every report that is not of type EXPENSE before 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 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:

    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 into reportsToPay. The For You "Pay" tile in ForYouSection reads 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 (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.
  7. melvin-bot commented on May 6, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @huult (External)

  8. oqildev commented on May 6, 2026

    @oqildev
    Contributor

    Proposal

    What is the root cause of that problem?

    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.
  9. changed the title [-]“For You” Section Missing Classic Inbox Reports (Mismatch with Supportal)[/-] [+][$250] “For You” Section Missing Classic Inbox Reports (Mismatch with Supportal)[/+] on May 6, 2026
  10. melvin-bot commented on May 6, 2026

    @melvin-bot
  11. github-actions commented on May 6, 2026

    @github-actions
    Contributor

    ⚠️ @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).

  12. trasnake87 commented on May 6, 2026

    @trasnake87
    Contributor

    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 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.

    src/libs/actions/OnyxDerived/configs/todos.ts:52-55:

    for (const report of reports) {
        if (!report?.reportID || report.type !== CONST.REPORT.TYPE.EXPENSE) {
            continue;
        }

    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:

    // src/libs/ReportPrimaryActionUtils.ts:230-247
    const isIOUReport = isIOUReportUtils(report);
    if (isIOUReport && isReportPayer && reimbursableSpend > 0) {
        return true;
    }
    const isInvoiceReport = isInvoiceReportUtils(report);
    if (!isInvoiceReport) {
        return false;
    }
    const parentReport = getParentReport(report);
    if (parentReport?.invoiceReceiver?.type === CONST.REPORT.INVOICE_RECEIVER_TYPE.INDIVIDUAL && reimbursableSpend > 0) {
        return parentReport?.invoiceReceiver?.accountID === currentUserAccountID;
    }
    return invoiceReceiverPolicy?.role === CONST.POLICY.ROLE.ADMIN && reimbursableSpend > 0;

    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:

    const [invoiceReceiverPolicy] = useOnyx(
        `${ONYXKEYS.COLLECTION.POLICY}${chatReport?.invoiceReceiver && 'policyID' in chatReport.invoiceReceiver ? chatReport.invoiceReceiver.policyID : undefined}`,
    );

    todos.ts neither resolves the parent chat nor reads the receiver policy, so even after fixing (1), workspace-invoice admins would still be missed.

    3 — reportNameValuePairs is looked up under the wrong key.

    src/libs/actions/OnyxDerived/configs/todos.ts:57:

    const reportNameValuePair = allReportNameValuePairs?.[`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report.chatReportID}`];

    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 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.

    src/libs/actions/OnyxDerived/configs/todos.ts:81:

    if (isExportAction(report, login, policy, reportActions) && policy?.exporter === login) {
        reportsToExport.push(report);
    }

    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-level policy.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 (const report of reports) {
        if (!report?.reportID) {
            continue;
        }
        const isExpense = report.type === CONST.REPORT.TYPE.EXPENSE;
        const isIOU = report.type === CONST.REPORT.TYPE.IOU;
        const isInvoice = report.type === CONST.REPORT.TYPE.INVOICE;
        if (!isExpense && !isIOU && !isInvoice) {
            continue;
        }
    
        const policy = allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report.policyID}`];
    
        // (3) Key the rNVP by the report's own reportID, matching every other call site.
        const reportNameValuePair = allReportNameValuePairs?.[`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report.reportID}`];
    
        const reportActions = Object.values(allReportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report.reportID}`] ?? []);
        const reportTransactions = transactionsByReportID[report.reportID] ?? [];
        const reportMetadata = allReportMetadata?.[`${ONYXKEYS.COLLECTION.REPORT_METADATA}${report.reportID}`];
    
        // (2) Resolve the invoice receiver policy for the workspace-invoice "admin pays" path.
        const chatReport = report.chatReportID ? allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${report.chatReportID}`] : undefined;
        const invoiceReceiverPolicyID =
            chatReport?.invoiceReceiver && 'policyID' in chatReport.invoiceReceiver ? chatReport.invoiceReceiver.policyID : undefined;
        const invoiceReceiverPolicy = 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.

  13. self-assigned this
    on May 6, 2026
  14. mountiny commented on May 6, 2026

    @mountiny
    Contributor

    Based on logs analysis the OpenApp was never triggered which seems to be the same issue as #89745 fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions