Skip to content

[Due for Payment 2026-04-09][$250] Cards-'Got it' button modal is not displayed in offline #79022

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: V9.2.95
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #78824
Email or phone of affected tester (no customers): dreamnitethedragon+yydyd373@gmail.com
Issue reported by: Applause Internal Team
Bug source: Pull Request QA execution
Device used: Redminote 10S Android 13
App Component: Workspace Settings

Action Performed:

Preconditions: Workspace has issued an Expensify card to the member

  1. Launch app
  2. Go offline
    3.Navigate to the Workspace Overview
    4.Click on the More button
    5.Select the Delete option
    6.Click on the Delete button

Expected Result:

Got it' button modal must be displayed in offline.

Actual Result:

'Got it' button modal is not displayed in offline.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7042922_1767801877115.Screenrecorder-2026-01-07-21-29-44-1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022010420267674347485
  • Upwork Job ID: 2010420267674347485
  • Last Price Increase: 2026-01-21
  • Automatic offers:
    • huult | Contributor | 110199807
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

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

    @melvin-bot

    Triggered auto assignment to @garrettmknight (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. twinkle-react commented on Jan 7, 2026

    @twinkle-react

    Proposal

    Please re-state the problem that we are trying to solve in this issue.
    When a user attempts to delete a workspace while offline, the "Got it" modal is not displayed. Instead, the code proceeds with the deletion API call, immediately closes the modal, and navigates back. Users are not informed that the action could not be completed due to connectivity issues, leading to confusion.

    What is the root cause of that problem?
    The confirmDelete function in WorkspaceOverviewPage.tsx does not handle offline scenarios properly. It calls the deletion API and closes the modal without checking if the user is offline. Unlike card assignment, there is no offline modal displayed before attempting deletion.

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

    • Update confirmDelete to check for offline status before making the deletion API call.
    • If the user is offline, close the delete confirmation modal and open a dedicated offline modal with a "Got it" button (DecisionModal).
    • Add the necessary state variable isOfflineModalOpen to control visibility of the offline modal.
    • Ensure the navigation logic remains unchanged and no deletion API call is triggered while offline.

    Code changes:

    // File: src/pages/workspace/WorkspaceOverviewPage.tsx
    
    // Line 10
    import ConfirmModal from '@components/ConfirmModal';
    import DecisionModal from '@components/DecisionModal';
    
    // Lines 163-164
    const [isCannotLeaveWorkspaceModalOpen, setIsCannotLeaveWorkspaceModalOpen] = useState(false);
    const [isOfflineModalOpen, setIsOfflineModalOpen] = useState(false);
    
    // Lines 216-253
    const confirmDelete = useCallback(() => {
        if (!policy?.id || !policyName) {
            return;
        }
    
        if (isOffline) {
            setIsDeleteModalOpen(false);
            setIsOfflineModalOpen(true);
            return;
        }
    
        deleteWorkspace({
            policyID: policy.id,
            activePolicyID,
            policyName,
            lastAccessedWorkspacePolicyID,
            policyCardFeeds: defaultCardFeeds,
            reportsToArchive,
            transactionViolations,
            reimbursementAccountError,
            bankAccountList,
            lastUsedPaymentMethods: lastPaymentMethod,
            localeCompare,
            personalPolicyID,
        });
    }, [
        policy?.id,
        policyName,
        lastAccessedWorkspacePolicyID,
        defaultCardFeeds,
        reportsToArchive,
        transactionViolations,
        reimbursementAccountError,
        lastPaymentMethod,
        localeCompare,
        isOffline,
        activePolicyID,
        bankAccountList,
        personalPolicyID,
    ]);
    
    // Line 523
    <DecisionModal
        title={translate('common.youAppearToBeOffline')}
        prompt={translate('common.offlinePrompt')}
        isSmallScreenWidth={shouldUseNarrowLayout}
        onSecondOptionSubmit={() => setIsOfflineModalOpen(false)}
        secondOptionText={translate('common.buttonConfirm')}
        isVisible={isOfflineModalOpen}
        onClose={() => setIsOfflineModalOpen(false)}
    />

    What alternative solutions did you explore? (Optional)

    • Reusing card assignment offline modal directly — rejected because the workspace deletion flow needs a dedicated modal context to avoid coupling unrelated flows.
  4. daledah commented on Jan 7, 2026

    @daledah

    Proposal

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

    'Got it' button modal is not displayed in offline.

    What is the root cause of that problem?

    We don't cover this modal in WorkspaceOverviewPage in front end and still call DeleteWorkspace API then get the error

    Image

    <ConfirmModal
    title={translate('workspace.common.delete')}
    isVisible={isDeleteWorkspaceErrorModalOpen}
    onConfirm={hideDeleteWorkspaceErrorModal}
    onCancel={hideDeleteWorkspaceErrorModal}
    prompt={policyLastErrorMessage}
    confirmText={translate('common.buttonConfirm')}
    shouldShowCancelButton={false}
    success={false}
    />

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

    We should add the validation before call DeleteWorkspace API in offline mode by using hasCardFeedOrExpensifyCard variable (Or we could create another variable to make it compatible with the logic in the back end.)

        const [isDeleteWorkspaceWithCardsOfflineModalOpen, setIsDeleteWorkspaceWithCardsOfflineModalOpen] = useState(false);
        ...
        const onDeleteWorkspace = useCallback(() => {
            if (isOffline && hasCardFeedOrExpensifyCard) {
                setIsDeleteWorkspaceWithCardsOfflineModalOpen(true);
                return;
            }
    

    const onDeleteWorkspace = useCallback(() => {

                <ConfirmModal
                    title={translate('workspace.common.delete')}
                    isVisible={isDeleteWorkspaceWithCardsOfflineModalOpen}
                    onConfirm={() => setIsDeleteWorkspaceWithCardsOfflineModalOpen(false)}
                    onCancel={() => setIsDeleteWorkspaceWithCardsOfflineModalOpen(false)}
                    prompt={'Your company still has open Expensify Cards.'}
                    confirmText={translate('common.buttonConfirm')}
                    shouldShowCancelButton={false}
                    success={false}
                />
    

    Note: we should do the same in WorkspaceListPage component

    What alternative solutions did you explore? (Optional)

    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.

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jan 11, 2026
  6. changed the title [-]Cards-'Got it' button modal is not displayed in offline[/-] [+][$250] Cards-'Got it' button modal is not displayed in offline[/+] on Jan 11, 2026
  7. melvin-bot commented on Jan 11, 2026

    @melvin-bot
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 11, 2026
  9. melvin-bot commented on Jan 11, 2026

    @melvin-bot

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

  10. 36 remaining items

  11. melvin-bot commented on Apr 7, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  12. Pujan92 commented on Apr 8, 2026

    @Pujan92

    I would say this is a new change and not a bug so no checklist is needed

    Regression Test Proposal

    Preconditions: The workspace has issued an Expensify Card to the member.

    1. Open the Expensify app.
    2. Go offline.
    3. Navigate to the Workspace Overview or Workspace List.
    4. Click the More button.
    5. Select Delete.
    6. Click the Delete button.
    7. Verify that the “Can’t delete” warning modal with a “Got it” button is displayed while offline.
  13. mallenexpensify commented on Apr 10, 2026

    @mallenexpensify

    Payment Summary

    Contributor: @huult due $250 via NewDot
    Contributor+: @Pujan92 due $250 via NewDot

    ^ Test case created

    Thx

  14. twisterdotcom commented on Apr 13, 2026

    @twisterdotcom

    @huult has submitted payment for this report on ND here.

    SO: https://stackoverflowteams.com/c/expensify/questions/7582

    Zapier Logs Run ID: 00040eee-c39e-a9b3-2bd0-d3c3ff8d8ec4
  15. garrettmknight commented on Apr 14, 2026

    @garrettmknight

    $250 approved for @Pujan92

  16. JmillsExpensify commented on Apr 30, 2026

    @JmillsExpensify

    $250 approved for @huult

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions