Skip to content

[HOLD for payment 2024-07-24] [$250] Concierge - There is submit, split and pay options in Concierge chat #44985

Closed

Description

@lanitochka17

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.0.5-4
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to Concierge chat
  3. Click +

Expected Result:

There will be no submit, split and pay options in Concierge chat

Actual Result:

There is submit, split and pay options in Concierge chat

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6536003_1720451847402.20240708_231508.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01bee66e73dbacfc76
  • Upwork Job ID: 1810949265008721349
  • Last Price Increase: 2024-07-10
  • Automatic offers:
    • paultsimura | Reviewer | 103077735
Issue OwnerCurrent Issue Owner: @dylanexpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 8, 2024
  2. melvin-bot commented on Jul 8, 2024

    @melvin-bot

    Triggered auto assignment to @dylanexpensify (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. lanitochka17 commented on Jul 8, 2024

    @lanitochka17
    Author

    @dylanexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

  4. lanitochka17 commented on Jul 8, 2024

    @lanitochka17
    Author

    We think that this bug might be related to #vip-vsp

  5. Krishna2323 commented on Jul 8, 2024

    @Krishna2323
    Contributor

    Proposal

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

    Concierge - There is submit, split and pay options in Concierge chat

    What is the root cause of that problem?

    We aren't checking for expensify only chats in getMoneyRequestOptions. We check for that before adding taskOption.

    App/src/libs/ReportUtils.ts

    Lines 5850 to 5854 in 547336d

    function getMoneyRequestOptions(report: OnyxEntry<Report>, policy: OnyxEntry<Policy>, reportParticipants: number[], filterDeprecatedTypes = false): IOUType[] {
    // In any thread or task report, we do not allow any new expenses yet
    if (isChatThread(report) || isTaskReport(report) || isInvoiceReport(report) || isSystemChat(report)) {
    return [];
    }

    App/src/libs/ReportUtils.ts

    Lines 1132 to 1142 in 547336d

    function canCreateTaskInReport(report: OnyxEntry<Report>): boolean {
    const otherParticipants = Object.keys(report?.participants ?? {})
    .map(Number)
    .filter((accountID) => accountID !== currentUserAccountID);
    const areExpensifyAccountsOnlyOtherParticipants = otherParticipants.length >= 1 && otherParticipants.every((accountID) => CONST.EXPENSIFY_ACCOUNT_IDS.includes(accountID));
    if (areExpensifyAccountsOnlyOtherParticipants && isDM(report)) {
    return false;
    }
    return true;
    }

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

    Use || isExpensifyOnlyParticipantInReport(report) here so it returns empty array.

    What alternative solutions did you explore? (Optional)

    We can use isExpensifyOnlyParticipantInReport in AttachmentPickerWithMenuItems if we don't want to add that in getMoneyRequestOptions.

  6. ShridharGoel commented on Jul 8, 2024

    @ShridharGoel
    Contributor

    Proposal

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

    There is submit, split and pay options in Concierge chat.

    What is the root cause of that problem?

    In the below code, there's no check to return empty list for concierge chat:

    App/src/libs/ReportUtils.ts

    Lines 5851 to 5854 in 547336d

    // In any thread or task report, we do not allow any new expenses yet
    if (isChatThread(report) || isTaskReport(report) || isInvoiceReport(report) || isSystemChat(report)) {
    return [];
    }

    Also, there's another bug. isConciergeChatReport logic doesn't filter out the logged in user:

    App/src/libs/ReportUtils.ts

    Lines 1046 to 1049 in 547336d

    function isConciergeChatReport(report: OnyxInputOrEntry<Report>): boolean {
    const participantAccountIDs = Object.keys(report?.participants ?? {});
    return participantAccountIDs.length === 1 && Number(participantAccountIDs[0]) === CONST.ACCOUNT_ID.CONCIERGE && !isChatThread(report);
    }

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

    Update isConciergeChatReport method to filter out the logged in user:

    function isConciergeChatReport(report: OnyxInputOrEntry<Report>): boolean {
        const participantAccountIDs = Object.keys(report?.participants ?? {})
            .map(Number)
            .filter((accountID) => accountID !== currentUserAccountID);
        return participantAccountIDs.length === 1 && Number(participantAccountIDs[0]) === CONST.ACCOUNT_ID.CONCIERGE && !isChatThread(report);
    }
    

    Then, add || isConciergeChatReport(report) check in getMoneyRequestOptions.

    if (isChatThread(report) || isTaskReport(report) || isInvoiceReport(report) || isSystemChat(report) || isConciergeChatReport(report)) {
        return [];
    }
    

    Else, we can also use isExpensifyOnlyParticipantInReport instead of just concierge check if we want to exclude all accounts in CONST.EXPENSIFY_ACCOUNT_IDS.

  7. bernhardoj commented on Jul 9, 2024

    @bernhardoj
    Contributor

    Proposal

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

    There is money request option shown in Concierge chat.

    What is the root cause of that problem?

    Currently, we already have a condition to not show money request options for expensify chat including Concierge.

    App/src/libs/ReportUtils.ts

    Lines 5862 to 5867 in dd96852

    // We don't allow IOU actions if an Expensify account is a participant of the report, unless the policy that the report is on is owned by an Expensify account
    const doParticipantsIncludeExpensifyAccounts = lodashIntersection(reportParticipants, CONST.EXPENSIFY_ACCOUNT_IDS).length > 0;
    const isPolicyOwnedByExpensifyAccounts = report?.policyID ? CONST.EXPENSIFY_ACCOUNT_IDS.includes(getPolicy(report?.policyID ?? '-1')?.ownerAccountID ?? -1) : false;
    if (doParticipantsIncludeExpensifyAccounts && !isPolicyOwnedByExpensifyAccounts) {
    return [];
    }

    However, isPolicyOwnedByExpensifyAccounts is always true. For Concierge, the policyID is __FAKE__ because it's not tied to a policy. Because it's not tied to a policy, the ownerAccountID defaults to -1 and when we check CONST.EXPENSIFY_ACCOUNT_IDS.includes(-1), it returns true.

    (This happens after the default to -1 PR. Previously, the default ownerAccountID is 0)

    That's because in the list, there are some account IDs that default to -1.

    App/src/CONST.ts

    Line 1570 in dd96852

    ADMIN: Number(Config?.EXPENSIFY_ACCOUNT_ID_ADMIN ?? -1),

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

    Filter out account IDs of -1.

    App/src/CONST.ts

    Lines 2275 to 2294 in dd96852

    get EXPENSIFY_ACCOUNT_IDS() {
    return [
    this.ACCOUNT_ID.ACCOUNTING,
    this.ACCOUNT_ID.ADMIN,
    this.ACCOUNT_ID.BILLS,
    this.ACCOUNT_ID.CHRONOS,
    this.ACCOUNT_ID.CONCIERGE,
    this.ACCOUNT_ID.CONTRIBUTORS,
    this.ACCOUNT_ID.FIRST_RESPONDER,
    this.ACCOUNT_ID.HELP,
    this.ACCOUNT_ID.INTEGRATION_TESTING_CREDS,
    this.ACCOUNT_ID.PAYROLL,
    this.ACCOUNT_ID.QA,
    this.ACCOUNT_ID.QA_TRAVIS,
    this.ACCOUNT_ID.RECEIPTS,
    this.ACCOUNT_ID.REWARDS,
    this.ACCOUNT_ID.STUDENT_AMBASSADOR,
    this.ACCOUNT_ID.SVFG,
    ];
    },

    OR

    Only call includes when the ownerAccountID is > 0, otherwise return false.

    const isPolicyOwnedByExpensifyAccounts = report?.policyID ? CONST.EXPENSIFY_ACCOUNT_IDS.includes(getPolicy(report?.policyID ?? '-1')?.ownerAccountID ?? -1) : false;

  8. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jul 10, 2024
  9. melvin-bot commented on Jul 10, 2024

    @melvin-bot
  10. changed the title [-]Concierge - There is submit, split and pay options in Concierge chat[/-] [+][$250] Concierge - There is submit, split and pay options in Concierge chat[/+] on Jul 10, 2024
  11. dylanexpensify commented on Jul 10, 2024

    @dylanexpensify
    Contributor

    moving

  12. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jul 10, 2024
  13. melvin-bot commented on Jul 10, 2024

    @melvin-bot

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

  14. 15 remaining items

  15. changed the title [-][$250] Concierge - There is submit, split and pay options in Concierge chat[/-] [+][HOLD for payment 2024-07-24] [$250] Concierge - There is submit, split and pay options in Concierge chat[/+] on Jul 17, 2024
  16. melvin-bot commented on Jul 17, 2024

    @melvin-bot

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

  17. melvin-bot commented on Jul 17, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.7-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 2024-07-24. 🎊

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

  18. melvin-bot commented on Jul 17, 2024

    @melvin-bot

    BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

    • [@paultsimura] The PR that introduced the bug has been identified. Link to the PR:
    • [@paultsimura] 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:
    • [@paultsimura] A discussion in #expensify-bugs 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:
    • [@paultsimura] Determine if we should create a regression test for this bug.
    • [@paultsimura] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
    • [@dylanexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  19. dylanexpensify commented on Jul 22, 2024

    @dylanexpensify
    Contributor

    Payment coming up!

  20. paultsimura commented on Jul 22, 2024

    @paultsimura
    Contributor

    Regression Test Proposal

    1. Log in as any account
    2. Open the Concierge chat
    3. Click "+"
    4. Verify there are no payment-related options in the menu

    Do we agree 👍 or 👎

  21. dylanexpensify commented on Jul 24, 2024

    @dylanexpensify
    Contributor

    Payment summary:

    Please apply/request!

  22. dylanexpensify commented on Jul 24, 2024

    @dylanexpensify
    Contributor

    Done

  23. JmillsExpensify commented on Jul 24, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @bernhardoj

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