Skip to content

[Due for payment 2025-05-20] [$250] Workspaces - 'Collect' plan is displayed instead of 'Control' #59473

Closed
1 of 1 issue completed

Description

@nlemma

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.22-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, reproducible on both
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/cases/view/2990420
Email or phone of affected tester (no customers): testexpensify9+onv5@gmail.com
Issue reported by: Applause Internal Team
Device used: Samsung A15, Android 14 | iPhone SE 3rd generation (2022), iOS 18.4
App Component: Other

Action Performed:

  1. Open Hybrid app
  2. Sign up
  3. Tap on 'Manage my team's expenses' > '1-10 employees' > 'QuickBooks Desktop' > 'Continue'
  4. Tap on 'Settings > 'Workspaces'

Expected Result:

The plan 'Control' should be displayed.

Actual Result:

The plan 'Collect' is displayed.

If concierge chat is not open, then the 'Collect' plan is shown in WS preview. if Concierge chat is opened, and you go to Workspaces, 'Control' plan is shown. Also, If you open the WS and go to ‘Overview’ it also corrects to ‘Control'.
It is also reproducible on bigger screens if their windows is resized.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6789092_1743526743408.a_recorder_20250401_134404.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021907171898904296032
  • Upwork Job ID: 1907171898904296032
  • Last Price Increase: 2025-04-15
  • Automatic offers:
    • jaydamani | Contributor | 106968585
Issue OwnerCurrent Issue Owner: @lschurr

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Apr 1, 2025
  2. melvin-bot commented on Apr 1, 2025

    @melvin-bot

    Triggered auto assignment to @lschurr (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. jaydamani commented on Apr 1, 2025

    @jaydamani
    Contributor

    Proposal

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

    After onboarding with integration purpose, 'Collect' plan is displayed instead of 'Control'

    What is the root cause of that problem?

    The CompleteGuidedSetup API called after onboarding does not return updated workspace plan

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

    Update backend to return updated policy type when an integration is selected

    Also update the prepareOnboardingOnyxData function to change type of the policy to corporate for optimistic data and back to previous value for failure data

    Note

    Need to confirm with internal member if all integrations require control/corporate plan and workspace plan is only upgraded when user selects an integration. If this is not the case, we can update the conditions accordingly

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

    Check prepareOnboardingOnyxData returns correct value for poilcy type based on if an integration was passed or not

    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. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Apr 1, 2025
  5. melvin-bot commented on Apr 1, 2025

    @melvin-bot
  6. changed the title [-]Workspaces - 'Collect' plan is displayed instead of 'Control'[/-] [+][$250] Workspaces - 'Collect' plan is displayed instead of 'Control'[/+] on Apr 1, 2025
  7. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Apr 1, 2025
  8. melvin-bot commented on Apr 1, 2025

    @melvin-bot

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

  9. thelullabyy commented on Apr 2, 2025

    @thelullabyy
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-04-02 04:07:29 UTC.

    Proposal

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

    • On the Workspaces page, the 'Collect' plan is displayed instead of 'Control' after completing the onboarding flow.

    What is the root cause of that problem?

    • After completing onboarding, we call the CompleteGuidedSetup API, which sets the policy type to corporate (Control) when appropriate (e.g., when integrations like NetSuite or QuickBooks Desktop are selected).

    • However, while the API call is still in progress, the frontend continues to display the policy as team (Collect) because we don’t optimistically set the policy type to corporate in the relevant Onyx merge:

      if (userReportedIntegration) {

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

    • If the user selects netsuite, intacct, or quickbookDesktop during onboarding, we should optimistically set the policy type to corporate (Control) so the UI reflects the correct plan immediately.

    • For other integrations, the policy type should remain unchanged.

    • This logic should be implemented at the following location:

      if (userReportedIntegration) {

    const accountingIntegrationData = getAccountingIntegrationData(userReportedIntegration, onboardingPolicyID ?? '', Localize.translateLocal);
    if (accountingIntegrationData?.workspaceUpgradeNavigationDetails) {
        optimisticData.push({
            onyxMethod: Onyx.METHOD.MERGE,
            key: \`\${ONYXKEYS.COLLECTION.POLICY}\${onboardingPolicyID}\`,
            value: {
                isPendingUpgrade: true,
                type: CONST.POLICY.TYPE.CORPORATE,
            },
        });
    
        successData.push({
            onyxMethod: Onyx.METHOD.MERGE,
            key: \`\${ONYXKEYS.COLLECTION.POLICY}\${onboardingPolicyID}\`,
            value: {
                isPendingUpgrade: false,
            },
        });
    
        failureData.push({
            onyxMethod: Onyx.METHOD.MERGE,
            key: \`\${ONYXKEYS.COLLECTION.POLICY}\${onboardingPolicyID}\`,
            value: {
                isPendingUpgrade: false,
            },
        });
    }

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

    • Add unit tests for the prepareOnboardingOnyxData function to validate behavior when userReportedIntegration is quickbookDesktop, ensuring the policy is optimistically updated to corporate.

    What alternative solutions did you explore? (Optional)

    • We could consider applying the full Onyx data configuration defined in:

      function upgradeToCorporate(policyID: string, featureName?: string) {

      instead of only setting isPendingUpgrade and type in the optimistic update.

  10. eVoloshchak commented on Apr 6, 2025

    @eVoloshchak
    Contributor

    @jaydamani's proposal:

    The CompleteGuidedSetup API called after onboarding does not return updated workspace plan

    Could you confirm if that's the case? This only works incorrectly for narrow screen layout, on Desktop and web desktop it works as expected.
    Why does this work incorrectly only for narrow screen layout?
    cc: @jaydamani, @thelullabyy

  11. jaydamani commented on Apr 6, 2025

    @jaydamani
    Contributor

    Why does this work incorrectly only for narrow screen layout?

    For web with wide screen, it comes from a GetMissingOnyxMessages called after ReadNewestAction which are not called in narrow screens. I am trying to investigate more but let me know your thoughts.
    @eVoloshchak

    Image

  12. jaydamani commented on Apr 6, 2025

    @jaydamani
    Contributor

    After investigating,

    The backend response does not include the new plan but it gets updated due to other requests related to the policy. Also note that based on this, regular users will see #admin after onboarding so the workspace should get updated by the openApp request

    This occurs on wide screen as well if we go offline before completing onboarding, so we would still need to update optimistic data

    Screen.Recording.2025-04-06.at.22.42.06.mov
  13. 31 remaining items

  14. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on May 13, 2025
  15. changed the title [-][$250] Workspaces - 'Collect' plan is displayed instead of 'Control'[/-] [+][Due for payment 2025-05-20] [$250] Workspaces - 'Collect' plan is displayed instead of 'Control'[/+] on May 13, 2025
  16. melvin-bot commented on May 13, 2025

    @melvin-bot

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

  17. melvin-bot commented on May 13, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.44-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-05-20. 🎊

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

  18. melvin-bot commented on May 13, 2025

    @melvin-bot

    @eVoloshchak @lschurr @eVoloshchak 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]

  19. lschurr commented on May 19, 2025

    @lschurr
    Contributor

    @eVoloshchak could you work on the checklist for this one?

  20. eVoloshchak commented on May 20, 2025

    @eVoloshchak
    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: N/A, this wasn't implemented initially

    • [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: regression was not critical

    • [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 Template
    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Test:

    1. Sign in with a new account
    2. Tap on 'Manage my team's expenses' > '1-10 employees' > 'QuickBooks Desktop' > 'Continue'
    3. Tap on 'Settings > 'Workspaces'
    4. Verify the workspace has the Control plan

    Do we agree 👍 or 👎

  21. lschurr commented on May 20, 2025

    @lschurr
    Contributor

    Payment summary:

  22. garrettmknight commented on Dec 7, 2025

    @garrettmknight
    Contributor

    $250 approved for @eVoloshchak

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

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions