Skip to content

[Due for payment 2025-09-16] [$250] New user disables company cards during onboarding, but we still show Connect your corporate card as an onboarding task #68928

Closed

Description

@m-natarajan

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.1.97-1
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @dylanexpensify
Slack conversation (hyperlinked to channel name): #Expensify Bugs

Action Performed:

  1. Sign up for New Expensify under Manage my team intent
  2. Select 11-50 size
  3. Select QBO as accounting integration
  4. Input personal details
  5. De-select company cards in features modal

Expected Result:

Connect your corporate card as an onboarding task is not shown

Actual Result:

Connect your corporate card as an onboarding task is shown

Workaround:

Unknown

Platforms:

Select the officially supported platforms where the issue was reproduced:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop
Platforms Tested: On which of our officially supported platforms was this issue tested:
  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Recording.1541.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021958681389059326901
  • Upwork Job ID: 1958681389059326901
  • Last Price Increase: 2025-08-22
  • Automatic offers:
    • mkzie2 | Contributor | 108539736
Issue OwnerCurrent Issue Owner: @jliexpensify

Activity

  1. added
    Daily
    Bug
    on Aug 21, 2025
  2. melvin-bot commented on Aug 21, 2025

    @melvin-bot

    Triggered auto assignment to @jliexpensify (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 Aug 21, 2025

    @daledah
    Contributor

    Proposal

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

    Connect your corporate card as an onboarding task is shown

    What is the root cause of that problem?

    With Manage Team selection, we define the tasks here

    const onboardingManageTeamMessage: OnboardingMessage = {
    message: translate(resolvedLocale, 'onboarding.messages.onboardingManageTeamMessage'),
    tasks: [createWorkspaceTask, testDriveAdminTask, addAccountingIntegrationTask, connectCorporateCardTask, inviteTeamTask, setupCategoriesAndTags, setupCategoriesTask, setupTagsTask],
    };

    [CONST.ONBOARDING_CHOICES.MANAGE_TEAM]: onboardingManageTeamMessage,

    And not filter here

    App/src/libs/ReportUtils.ts

    Lines 10352 to 10357 in 19c88b2

    const tasksData = onboardingMessage.tasks
    .filter((task) => {
    if (([CONST.ONBOARDING_TASK_TYPE.SETUP_CATEGORIES, CONST.ONBOARDING_TASK_TYPE.SETUP_TAGS] as string[]).includes(task.type) && userReportedIntegration) {
    return false;
    }

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

    We should filter connectCorporateCardTask when the company card is not enabled

    1. Create a new params in prepareOnboardingOnyxData function
        function prepareOnboardingOnyxData(
            ...
            areCompanyCardsEnabled?: boolean,
        ) 
    
    1. Filter connectCorporateCardTask when the company card is not enabled
        const tasksData = onboardingMessage.tasks
            .filter((task) => {
                if (task.type === CONST.ONBOARDING_TASK_TYPE.CONNECT_CORPORATE_CARD && !areCompanyCardsEnabled) {
                    return false;
                }
        ...
    

    App/src/libs/ReportUtils.ts

    Lines 10352 to 10357 in 19c88b2

    const tasksData = onboardingMessage.tasks
    .filter((task) => {
    if (([CONST.ONBOARDING_TASK_TYPE.SETUP_CATEGORIES, CONST.ONBOARDING_TASK_TYPE.SETUP_TAGS] as string[]).includes(task.type) && userReportedIntegration) {
    return false;
    }

    1. Pass areCompanyCardsEnabled from the BaseOnboardingInterestedFeatures component -> completeOnboarding function -> prepareOnboardingOnyxData function
            const areCompanyCardsEnabled = featuresMap.find((feature) => feature.id === 'company-cards')?.enabled;
            completeOnboarding({
                ...
                areCompanyCardsEnabled,
            });
    

    completeOnboarding({
    engagementChoice: onboardingPurposeSelected,
    onboardingMessage: onboardingMessages[onboardingPurposeSelected],
    adminsChatReportID,
    onboardingPolicyID: policyID,
    companySize: onboardingCompanySize,
    userReportedIntegration: newUserReportedIntegration,
    firstName: currentUserPersonalDetails?.firstName,
    lastName: currentUserPersonalDetails?.lastName,
    });

    Note: Above is the logic for company card feature, we can do the same with other features.

    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)

    Or we can pass all featuresMap to prepareOnboardingOnyxData function

  4. mkzie2 commented on Aug 21, 2025

    @mkzie2
    Contributor

    Proposal

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

    New user disables company cards during onboarding, but we still show Connect your corporate card as an onboarding task

    What is the root cause of that problem?

    We don't have the logic to filter out the corporate card task if the current user doesn't select company cards feature

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

    1. We should define a new parameter selectedInterestedFeatures and pass it to prepareOnboardingOnyxData function

    const onboardingData = prepareOnboardingOnyxData(

    1. In this function, we should check if the task is related to a feature that isn't in selectedInterestedFeatures list; we should filter out this task.
    const taskToFeature: Record<string, string> = {
        [CONST.ONBOARDING_TASK_TYPE.SETUP_CATEGORIES]: 'categories',
        [CONST.ONBOARDING_TASK_TYPE.ADD_ACCOUNTING_INTEGRATION]: 'accounting',
        [CONST.ONBOARDING_TASK_TYPE.CONNECT_CORPORATE_CARD]: 'company-cards',
        [CONST.ONBOARDING_TASK_TYPE.SETUP_TAGS]: 'tags',
    };
    const tasksData = onboardingMessage.tasks
            .filter((task) => {
                if (engagementChoice === CONST.ONBOARDING_CHOICES.MANAGE_TEAM) {
                    if (selectedInterestedFeatures?.length && taskToFeature[task.type] && !selectedInterestedFeatures.includes(taskToFeature[task.type])) {
                        return false;
                    }
                }
    

    App/src/libs/ReportUtils.ts

    Lines 10363 to 10365 in 73c4200

    const tasksData = onboardingMessage.tasks
    .filter((task) => {
    if (([CONST.ONBOARDING_TASK_TYPE.SETUP_CATEGORIES, CONST.ONBOARDING_TASK_TYPE.SETUP_TAGS] as string[]).includes(task.type) && userReportedIntegration) {

    1. Pass the selected feature to completeOnboarding function here
    selectedInterestedFeatures: featuresMap.filter((feature) => feature.enabled).map((feature) => feature.id),
    


    function prepareOnboardingOnyxData(

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

    Update prepareOnboardingOnyxData unit test to verify that the onboarding task doesn't contain the task related to a disabled feature.

    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
    External
    on Aug 22, 2025
  6. changed the title [-]New user disables company cards during onboarding, but we still show Connect your corporate card as an onboarding task[/-] [+][$250] New user disables company cards during onboarding, but we still show Connect your corporate card as an onboarding task[/+] on Aug 22, 2025
  7. melvin-bot commented on Aug 22, 2025

    @melvin-bot
  8. added
    Help Wanted
    on Aug 22, 2025
  9. melvin-bot commented on Aug 22, 2025

    @melvin-bot

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

  10. yuta147586 commented on Aug 22, 2025

    @yuta147586

    Proposal — Gate “Connect your corporate card” task behind a single source-of-truth flag

    Hypothesis
    Task visibility reads a stale/wrong flag (Policy vs onboarding NVP) and isn’t re-evaluated after the features modal updates Onyx.

    Plan

    Add guarded selector shouldShowCorporateCardTask(policyID) that:
    – Reads the canonical Policy.features.companyCardsEnabled
    – Applies role guard (admins only)
    – Uses safe default (missing ⇒ false)

    Replace ad-hoc checks in onboarding task builder with this selector.

    After modal save, invalidate/bust Onyx keys so the selector re-evaluates.

    Tests: unit (enabled/disabled/missing/roles) + smoke/E2E (disable ⇒ hidden, re-enable ⇒ shown) across Web/Desktop/iOS/Android.

    Acceptance criteria

    Cards disabled ⇒ task not rendered for any role

    Cards enabled ⇒ task shown for eligible admins only

    Toggle reflects immediately after save (no stale UI)

    All tests pass; no regressions to other onboarding tasks

    Estimate: 4–6 hours incl. tests & screenshots.
    If approved, I’ll implement on a fork/branch and open a PR.
    cc @s77rt

  11. melvin-bot commented on Aug 22, 2025

    @melvin-bot

    📣 @yuta147586! 📣
    Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
    Please follow these steps:

    1. Make sure you've read and understood the contributing guidelines.
    2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
    3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
    4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
      Screen Shot 2022-11-16 at 4 42 54 PM
      Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
    
  12. 38 remaining items

  13. changed the title [-][$250] New user disables company cards during onboarding, but we still show Connect your corporate card as an onboarding task[/-] [+][Due for payment 2025-09-16] [$250] New user disables company cards during onboarding, but we still show Connect your corporate card as an onboarding task[/+] on Sep 9, 2025
  14. removed
    Reviewing
    on Sep 9, 2025
  15. melvin-bot commented on Sep 9, 2025

    @melvin-bot

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

  16. melvin-bot commented on Sep 9, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.2-8 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 2025-09-16. 🎊

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

  17. melvin-bot commented on Sep 9, 2025

    @melvin-bot

    @hungvu193 @jliexpensify 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]

  18. jliexpensify commented on Sep 15, 2025

    @jliexpensify
    Contributor

    Bumping @hungvu193 for the checklist please!

  19. hungvu193 commented on Sep 15, 2025

    @hungvu193
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [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.

      Link to comment: https://github.com/Expensify/App/pull/59386/files#r2348193608

    • [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: N/A

    • [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

    Test:

    1. Sign up for New Expensify under Manage my team intent
    2. Select 11-50 size
    3. Select QBO as accounting integration
    4. Input personal details
    5. De-select company cards in the features modal and complete the onboarding.
    6. Verify that the Connect your corporate card task doesn't appear

    Do we agree 👍 or 👎

  20. jliexpensify commented on Sep 15, 2025

    @jliexpensify
    Contributor

    Payment Summary

    • C: @mkzie2 $250 (to be paid via Upworks)
    • C+: @hungvu193 $250 (to be paid via New Expensify payments)

    Upwork job

  21. added
    Daily
    and removed
    Weekly
    on Sep 15, 2025
  22. hungvu193 commented on Sep 16, 2025

    @hungvu193
    Contributor

    Requested on ND

  23. JmillsExpensify commented on Sep 16, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @hungvu193

  24. jliexpensify commented on Sep 16, 2025

    @jliexpensify
    Contributor

    Paid and job closed!

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions