Skip to content

Search page shows Pay action for expense reports on personal/deleted policies #91456

@luacmartins

Description

@luacmartins

Problem

The Search page surfaces a Pay button for closed expense reports on personal policies and deleted policies, even though paying such reports always fails server-side with a 406 Unsupported policy type for this action error.

Auth's guard at PayMoneyRequest.cpp:254 correctly rejects these payments because:

  • Policy type is not corporate or team (personal policy), OR
  • Policy has been deleted (NVP renamed to private_expensify_DELETED_policy{ID}), causing Policy::getType() to return an empty string

This means users can initiate a batch-pay from Search (PayMoneyRequestOnSearch) that silently fails, with the error embedded in the Onyx snapshot update rather than surfaced as a clear UI message.

Root Cause

canIOUBePaid contains an isPaidGroupPolicy check, but there appears to be a stale-snapshot path through the negative-amount "Mark as paid Elsewhere" flow in Search that bypasses this gate and still renders the Pay action.

Related server-side issue: Expensify/Expensify#619510

Expected Behavior

The Pay action should not be shown in Search for expense reports on:

  • Personal policies
  • Deleted policies

Actual Behavior

The Pay button is shown and when tapped it results in a silent failure (406 from server), giving users no clear feedback about why the action cannot be completed.

Version

Reproduced on 9.3.78-1 (latest as of May 2026)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions