Skip to content

Expensify Card - No error message when deleting workspace with Expensify card #71966

Closed

Description

@jponikarchuk

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.24-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: https://test-management.browserstack.com/projects/2219752/test-runs/TR-1162/folder/13176890/41237378/936935479
Email or phone of affected tester (no customers): applausetester+sdjoisjnso@applause.expensifail.com
Issue reported by: Applause Internal Team
Device used: Mac 15.5 / Chrome
App Component: Search

Action Performed:

Precondition:

  • Workspace is set up with Expensify card and has assigned at least one card to any member.
  1. Go to staging.new.expensify.com
  2. Go to Workspaces.
  3. Click 3-dot menu > Delete workspace.
  4. Delete the workspace.

Expected Result:

There should be an error message saying that the workspace cannot be deleted because it has Expensify card.

Actual Result:

There is no error message when deleting workspace with Expensify card.
The workspace reappears with RBR on Workspaces tab.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

11.mp4

View all open jobs on GitHub

Activity

  1. added
    Daily
    Bug
    on Oct 7, 2025
  2. melvin-bot commented on Oct 7, 2025

    @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. etCoderDysto commented on Oct 7, 2025

    @etCoderDysto
    Contributor

    Proposal

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

    Expensify Card - No error message when deleting workspace with Expensify card

    What is the root cause of that problem?

    We are passing false to shouldShowErrorMessages

    <OfflineWithFeedback
    key={`${item.title}_${index}`}
    pendingAction={item.pendingAction}
    errorRowStyles={styles.ph5}
    onClose={item.dismissError}
    errors={item.errors}
    style={styles.mb2}
    shouldShowErrorMessages={false}

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

    we shouldn't pass false to the prop

     <OfflineWithFeedback 
         key={`${item.title}_${index}`} 
         pendingAction={item.pendingAction} 
         errorRowStyles={styles.ph5} 
         onClose={item.dismissError} 
         errors={item.errors} 
         style={styles.mb2} 
    
    

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    none

    What alternative solutions did you explore? (Optional)

  4. paulnjs commented on Oct 7, 2025

    @paulnjs
    Contributor

    Proposal

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

    There is no error message when deleting workspace with Expensify card.
    The workspace reappears with RBR on Workspaces tab.

    What is the root cause of that problem?

    The error is hidden from this PR

    shouldShowErrorMessages={false}

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

    We want to remove the error from workspace list page and only display a RBR if the error related to these errors. But the error here related to delete error, we should display this error then the user can know the reason. We can display the error if brickRoadIndicator is not the error

    shouldShowErrorMessages={item.brickRoadIndicator !== CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR}
    

    Beside, we can also add a formal error in the failureData then if the backend doesn't return the error in Onyx data, we still can display an error message when the API is failed.

    shouldShowErrorMessages={false}

    onyxMethod: Onyx.METHOD.MERGE,

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    undefined

    What alternative solutions did you explore? (Optional)

    NA

    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. Eskalifer1 commented on Oct 7, 2025

    @Eskalifer1
    Contributor

    Proposal

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

    Expensify Card - No error message when deleting workspace with Expensify card

    What is the root cause of that problem?

    We don't want to display errors in the workspace list, but in this case, there is an error when deleting, so if we don't display anything, it confuses the user.

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

    We can hide the delete item if we know that this workspace has at least one card:

    const [cardSettings] = useOnyx(ONYXKEYS.COLLECTION.PRIVATE_EXPENSIFY_CARD_SETTINGS, {canBeMissing: true});

    const getMenuItem = useCallback(

    const workspaceAccountID = policies?.[`${ONYXKEYS.COLLECTION.POLICY}${item.policyID}`]?.workspaceAccountID;
    
                const getAllExpensifyCardFeeds = (cardSettings: OnyxCollection<ExpensifyCardSettings>) => {
                    const matchingEntries = Object.entries(cardSettings ?? {}).filter(([key, settings]) => {
                        const isDomainFeed = !!(settings?.preferredPolicy && settings.preferredPolicy === item?.policyID);
                        const isWorkspaceFeed = key.includes(workspaceAccountID?.toString?.() ?? ‘’) && settings && Object.keys(settings).length > 1;
                        return isDomainFeed || isWorkspaceFeed;
                    });
    
                    return Object.fromEntries(matchingEntries);
                };
    
                const expensifyCard = getAllExpensifyCardFeeds(cardSettings);

    if (isOwner && Object.keys(expensifyCard || {})?.length < 1)

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    N/A

    What alternative solutions did you explore? (Optional)

    When deleting a workspace, we can add another generic error to failureData, which will have a value like “Failed to delete Workspace,” and then we can check if there is such an error, and if it is in errors, pass this parameter as true.

    shouldShowErrorMessages={false}

    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.

  6. Pujan92 commented on Oct 13, 2025

    @Pujan92
    Contributor

    @mallenexpensify This can be closed in favor of #64015

  7. dominictb commented on Oct 13, 2025

    @dominictb
    Contributor

    @mallenexpensify Coming from #64015, confirm that this could be fixed in #64015:

    Screen.Recording.2025-10-14.at.02.20.51.mov

    cc @blimpich

  8. blimpich commented on Oct 13, 2025

    @blimpich
    Contributor

    Yup, this issue will be solved by that PR. So no need to assign this out to anyone new. @dominictb would you mind adding this to the list of issues solved by your PR?

  9. self-assigned this
    on Oct 13, 2025
  10. mallenexpensify commented on Oct 13, 2025

    @mallenexpensify
    Contributor

    Thx! Closing. Comment and tag me, if need be.

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

Metadata

Metadata

Labels

BugDaily

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions