Skip to content

Workspace - 'Issue new card' modals appears briefly when open Expensify card #73615

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: v9.2.39-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: #72020
Email or phone of affected tester (no customers): duytestnguyen+new182@gmail.com
Issue reported by: Applause Internal Team
Device used: Windows 11 Home/Chrome
App Component: Workspace Settings

Action Performed:

Precondition:

  • New Login or clearing cached in Account setting
  • Account has many workspaces. One workspace has expensify card, company card lists
  1. Open https://staging.new.expensify.com/
  2. Navigate to Workspace setting that has cards
  3. Click on 'Expensify card'
  4. Navigate back to Workspace setting
  5. Click on 'Company card'

Expected Result:

Card list should be shown immediately

Actual Result:

At step 3, 'Issue new card' modal appears briefly
At step 5, 'Add a card' modal appears briefly

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

1.mp4

View all open jobs on GitHub

Activity

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

    @melvin-bot

    Triggered auto assignment to @VictoriaExpensify (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 Oct 28, 2025

    @daledah
    Contributor

    Proposal

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

    At step 3, 'Issue new card' modal appears briefly
    At step 5, 'Add a card' modal appears briefly

    What is the root cause of that problem?

    It seems the problem is that initially when we go to the expensify card page we have paymentBankAccountID and isLoading here is false so we don't show ActivityIndicator here

    if (!!isLoading && !paymentBankAccountID) {
    return (
    <ActivityIndicator
    size={CONST.ACTIVITY_INDICATOR_SIZE.LARGE}
    style={styles.flex1}
    />
    );
    }

    And we show this

    if (paymentBankAccountID) {
    return (
    <WorkspaceExpensifyCardListPage
    cardsList={cardsList}
    fundID={defaultFundID}
    route={route}
    />
    );
    }

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

    We should update it to show the ActivityIndicator while isLoading is true

            if (!!isLoading || !paymentBankAccountID) { // we can consider to remove `!paymentBankAccountID` here
                return (
                    <ActivityIndicator
                        size={CONST.ACTIVITY_INDICATOR_SIZE.LARGE}
                        style={styles.flex1}
                    />
                );
            }
    

    if (!!isLoading && !paymentBankAccountID) {
    return (
    <ActivityIndicator
    size={CONST.ACTIVITY_INDICATOR_SIZE.LARGE}
    style={styles.flex1}
    />
    );
    }

    Note: We can also use isLoadingOnyxValue to update this condition. We can do the same with other pages

    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)

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

    @nkdengineer
    Contributor

    Proposal

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

    At step 3, 'Issue new card' modal appears briefly
    At step 5, 'Add a card' modal appears briefly

    What is the root cause of that problem?

    Here's the logic to detect isLoading

    const isLoading = !isOffline && (!cardFeeds || (!!cardFeeds.isLoading && isEmptyObject(cardsList)));

    but cardFeeds.isLoading is undefined at the beginning => isLoading is false so we show the empty state
    then we trigger fetchCompanyCards that updates cardFeeds.isLoading to true => isLoading is false so we show the loading indicator

    when the API calls successfully, cardFeeds.isLoading is false => isLoading is false so we show the empty state

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

    the logic to detect isLoading is incorrect, so we should update it. Let's create the new state isCardFeedsLoading, it should be true at the beginning the change the false only when the API calls successfully

    const [isCardFeedsLoading, setIsCardFeedsLoading] = useState(true);
    const isLoading = !isOffline && (!cardFeeds || (isCardFeedsLoading && isEmptyObject(cardsList)));
    const prevCardFeedsLoading = usePrevious(cardFeeds?.isLoading);
    useEffect(() => {
            if (prevCardFeedsLoading && !cardFeeds?.isLoading) {
                setIsCardFeedsLoading(false);
            }
        }, [cardFeeds?.isLoading, prevCardFeedsLoading]);
    

    we can do the same in ExpensifyCardPage

    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)

    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. melvin-bot commented on Oct 31, 2025

    @melvin-bot

    @VictoriaExpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!

  6. VictoriaExpensify commented on Nov 3, 2025

    @VictoriaExpensify
    Contributor

    I'm not sure this is worth putting resources into right now, the very breif pop-up is barely noticible - blink and you'd miss it, and I doubt anyone can actually see what it says.

    We can revisit this if a customer raises a concern about it. For now, I think there are plently of higher value issues to focus on

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