Skip to content

[Due for payment 2026-03-04] [$250] Company card - Company cards page loads each time opening it, error when opened offline #81080

Closed

Description

@mitarachim

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.3.11-17
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #80734
Email or phone of affected tester (no customers): applausetester+khcategory20@applause.expensifail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.1 / Chrome
App Component: Workspace Settings

Action Performed:

Precondition:

  • Workspace has a direct feed in Company cards page.
  1. Go to staging.new.expensify.com
  2. Go to workspace settings.
  3. Go to Company cards.
  4. Go to Categories.
  5. Go to Company cards.
  6. Go offline.
  7. Go to Categories.
  8. Go to Company cards.

Expected Result:

In Step 5, Company cards page will not load each time opening it.
In Step 8, no error will show up when opening Company cards page offline.

Actual Result:

In Step 5, Company cards page loads each time opening it.
In Step 8, error show sup when opening Company cards page offline.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7062437_1769819589527.3.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022017417169864608247
  • Upwork Job ID: 2017417169864608247
  • Last Price Increase: 2026-01-31
  • Automatic offers:
    • NJ-2020 | Contributor | 110348681
Issue OwnerCurrent Issue Owner: @kadiealexander

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    DeployBlockerIndicates it should block deploying the API
    on Jan 31, 2026
  2. melvin-bot commented on Jan 31, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #80734

  3. melvin-bot commented on Jan 31, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  4. melvin-bot commented on Jan 31, 2026

    @melvin-bot

    Triggered auto assignment to @kadiealexander (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.

  5. github-actions commented on Jan 31, 2026

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  6. OSBotify commented on Jan 31, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #80734 - "feat: Add frontend error for card feed backend load issue (AFTER REVERT)" by @chrispader (High confidence)
    Related Issues: None

    Recommendation: REVERT

    PR #80734 introduced error handling for failing OpenPolicyCompanyCardsFeed and OpenPolicyCompanyCardsPage API requests. However, the implementation has caused two issues:

    1. Page reloads each time: The useEffect in WorkspaceCompanyCardsPage.tsx (lines 57-63) has loadPolicyCompanyCardsPage in its dependency array. This creates unnecessary re-renders because the callback is recreated whenever its dependencies change, triggering the effect to run again.

    2. Offline error persists: When the page loads while offline, error handling sets an error in Onyx via the failureData in openPolicyCompanyCardsPage. However, there is no mechanism to clear this error when the user goes back online and navigates back to the Company cards page.

    Labels: Removing DeployBlockerCash is NOT appropriate - this is a frontend bug that requires changes to App to fix.

    Detailed Analysis

    Evidence

    The bug was introduced in PR #80734 which:

    • Added error handling for OpenPolicyCompanyCardsPage and OpenPolicyCompanyCardsFeed API calls
    • Modified WorkspaceCompanyCardsPage.tsx to wrap API calls in useCallback hooks
    • Added these callbacks to the dependency arrays of useEffect hooks

    Verification

    Files affected by the bug:

    • src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx - The main page component
    • src/libs/actions/CompanyCards.ts - The action that calls the API
    • src/pages/workspace/companyCards/WorkspaceCompanyCardsTable/index.tsx - The table component that displays errors

    PR #80734 modifies all of these files, specifically:

    • Lines 45-63 in WorkspaceCompanyCardsPage.tsx show the problematic useEffect with loadPolicyCompanyCardsPage in dependencies
    • Lines 842-882 in CompanyCards.ts show the openPolicyCompanyCardsPage function that sets errors in failureData

    Root Cause

    1. Reload issue: The useEffect dependency on loadPolicyCompanyCardsPage causes the effect to re-run whenever the callback is recreated. This happens every time the component mounts or when any of the callback's dependencies change, causing unnecessary API calls.

    2. Offline error: The error is set in Onyx through failureData when the API call fails offline, but the PR does not include logic to clear this error when:

      • The user goes back online
      • The user navigates away and back to the page
      • The user manually retries

    The "Try again" button calls onReloadPage which triggers openPolicyCompanyCardsPage again, but if you're offline, it just sets the same error again.

  7. 37 remaining items

  8. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Feb 25, 2026
  9. changed the title [-][$250] Company card - Company cards page loads each time opening it, error when opened offline[/-] [+][Due for payment 2026-03-04] [$250] Company card - Company cards page loads each time opening it, error when opened offline[/+] on Feb 25, 2026
  10. melvin-bot commented on Feb 25, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  11. melvin-bot commented on Feb 25, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.25-13 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-03-04. 🎊

    For reference, here are some details about the assignees on this issue:

  12. melvin-bot commented on Feb 25, 2026

    @melvin-bot

    @ZhenjaHorbach @kadiealexander The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  13. ZhenjaHorbach commented on Mar 3, 2026

    @ZhenjaHorbach
    Contributor

    BugZero Checklist:

    • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

    It's came from this PR

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion: NA

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    Regression Test Proposal

    Precondition:

    • Workspace has a direct feed in Company cards page.

    Test:

    1. Go to workspace settings.
    2. Go to Company cards.
    3. Go to Categories/any other page.
    4. Go to Company cards.
    5. Verify that: No skeleton loader is shown
    6. Go offline.
    7. Go to Categories/any other page.
    8. Go to Company cards.
    9. Verify that: No error state is shown

    Do we agree 👍 or 👎

    Zapier Logs Run ID: 00040eee-e9b5-abf5-5dfe-ffc799fe35f4
  14. kadiealexander commented on Mar 5, 2026

    @kadiealexander
    Contributor

    Payment Summary

  15. garrettmknight commented on Mar 6, 2026

    @garrettmknight
    Contributor

    $250 approved for @ZhenjaHorbach

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.DailyKSv2EngineeringExternalAdded 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