Skip to content

Expenses - Delete option is not displayed offline in Reports in bulk selected dropdown #78863

Closed

Description

@lanitochka17

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: 9.2.93-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #78325
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Bug source: Pull Request QA execution
Device used: MacBook Air 15.6.1 Chrome, iPhone 15 iOS 26.1 Safari
App Component: Search

Action Performed:

  1. Sign in to ND
  2. Create two expense in the workspace chat
  3. Go offline
  4. Navigate to Reports/ Expenses and select the two expenses
  5. Click "2 selected" green button and observe the options

Expected Result:

Delete option is presented in bulk selected dropdown menu offline in Reports/ Expenses, as it is presented in the workspace chat

Actual Result:

Delete option is not displayed in bulk selected dropdown menu offline in Reports/ Expenses

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7041776_1767635344669.No_delete_option_offline_1.mp4

View all open jobs on GitHub

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 5, 2026
  2. melvin-bot commented on Jan 5, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. daledah commented on Jan 5, 2026

    @daledah
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Delete option is not displayed in bulk selected dropdown menu offline in Reports/ Expenses

    What is the root cause of that problem?

    In SearchPage.tsx (used for Reports/Expenses), the delete option was hidden when offline due to a !isOffline check.

    const shouldShowDeleteOption =
    !isOffline &&
    selectedTransactionsKeys.every((id) => {

    What changes do you think we should make in order to solve the problem?

    we should remove the !isOffline && check

        const shouldShowDeleteOption = selectedTransactionsKeys.every((id) => {
                const transaction = currentSearchResults?.data?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${id}`];
        ...
    

    const shouldShowDeleteOption =
    !isOffline &&
    selectedTransactionsKeys.every((id) => {

    Note: we can do the same for other actions

    What alternative solutions did you explore? (Optional)

    N/A

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  4. abbasifaizan70 commented on Jan 5, 2026

    @abbasifaizan70
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    When a user is offline in the Reports/Expenses page (Search page), the Delete option is not displayed in the bulk selection dropdown menu. However, the same Delete option IS displayed when offline in the workspace chat. This creates an inconsistent user experience where bulk delete functionality is available in one place but hidden in another when offline.

    What is the root cause of that problem?

    The root cause is an inconsistent offline check between the Search page (Reports/Expenses) and the workspace chat:

    const shouldShowDeleteOption =
    !isOffline &&
    selectedTransactionsKeys.every((id) => {
    const transaction = currentSearchResults?.data?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${id}`];
    if (!transaction) {
    return false;
    }
    const parentReportID = transaction.reportID;
    const parentReport = currentSearchResults?.data?.[`${ONYXKEYS.COLLECTION.REPORT}${parentReportID}`];
    const reportActions = currentSearchResults?.data?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${parentReportID}`];
    const parentReportAction =
    Object.values(reportActions ?? {}).find(
    (action) => (isMoneyRequestAction(action) ? getOriginalMessage(action)?.IOUTransactionID : undefined) === transaction.transactionID,
    ) ?? selectedTransactions[id].reportAction;
    return canDeleteMoneyRequestReport(parentReport, [transaction], parentReportAction ? [parentReportAction] : []);
    });

    The !isOffline && condition explicitly hides the Delete option when the user is offline.

    const canAllSelectedTransactionsBeRemoved = selectedTransactionsList.every((transaction) => {
    const canRemoveTransaction = canDeleteCardTransactionByLiabilityType(transaction);
    const action = getIOUActionForTransactionID(reportActions, transaction.transactionID);
    const isActionDeleted = isDeletedAction(action);
    const isIOUActionOwner = typeof action?.actorAccountID === 'number' && typeof session?.accountID === 'number' && action.actorAccountID === session?.accountID;
    return canRemoveTransaction && isIOUActionOwner && !isActionDeleted;
    });
    const canRemoveReportTransaction = canDeleteTransaction(report, isReportArchived);
    if (canRemoveReportTransaction && canAllSelectedTransactionsBeRemoved) {
    options.push({
    text: translate('common.delete'),
    icon: expensifyIcons.Trashcan,
    value: CONST.REPORT.SECONDARY_ACTIONS.DELETE,
    onSelected: showDeleteModal,
    });

    There is NO !isOffline check here, so the Delete option is visible even when offline in the workspace chat.

    This inconsistency causes different behavior between the two screens.

    What changes do you think we should make in order to solve the problem?

    Remove the !isOffline && condition from the shouldShowDeleteOption variable in SearchPage.tsx.

    const shouldShowDeleteOption =
    !isOffline &&

    To:

    const shouldShowDeleteOption = selectedTransactionsKeys.every((id) => {
        // ... transaction validation logic
    });

    This change is safe because the onSelected handler already has logic to handle the offline case at

    value: CONST.SEARCH.BULK_ACTION_TYPES.DELETE,
    shouldCloseModalOnSelect: true,
    onSelected: () => {
    if (isOffline) {
    setIsOfflineModalVisible(true);
    return;

    onSelected: () => {
        if (isOffline) {
            setIsOfflineModalVisible(true);
            return;
        }
        // ... rest of the delete logic
    }

    When the user clicks Delete while offline, the existing handler will show an offline modal explaining that the action cannot be performed offline. This provides a consistent UX with the workspace chat where the option is visible but the action is gracefully blocked when offline.

    What alternative solutions did you explore? (Optional)

    None

    Demo

    Screen.Recording.2026-01-06.at.12.45.00.AM.mov
  5. mallenexpensify commented on Jan 6, 2026

    @mallenexpensify
    Contributor

    👀 please @DylanDylann and @eh2077 , you worked on the below which is linked in the OP. Is this a regression?

  6. DylanDylann commented on Jan 7, 2026

    @DylanDylann
    Contributor

    @mallenexpensify This isn’t a regression from #78325. Based on my review, this behavior is expected from the initial implementation.

  7. eh2077 commented on Jan 7, 2026

    @eh2077
    Contributor

    Yeah, I believe this isn't a regression from our PR as it wasn't supported before our PR. I thought we deliberately disable some offline operations on search pages. cc @luacmartins

  8. luacmartins commented on Jan 7, 2026

    @luacmartins
    Contributor

    I agree. We don't allow some actions to be taken offline on search because right now those actions use a separate DeleteMoneyRequestOnSearch API command that doesn't work with optimistic data.

  9. luacmartins commented on Jan 7, 2026

    @luacmartins
    Contributor

    We should just close this issue.

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions