Skip to content

[$500] Desktop/Web - IOU - CMD+Enter allows you to select users and WS into one Split Bill #29628

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: 1.3.84-0

Reproducible in staging?: Yes

Reproducible in production?: Yes

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: Applause - Internal Team

Slack conversation:

Action Performed:

Prerequisites:
Use an HT account that already has WS in it or create one in advance.

  1. Open New Expensify app
  2. Log into your HT account
  3. Click on the FAB button
  4. Click on 'Request Money'
  5. Choose 'Manual' and add an amount
  6. Click on the "Split" button next to WS
  7. Click on the "Split" button next to any user
  8. Press CMD+Enter(CTRL+Enter)

Expected Result:

CMD+Enter commands should not work in forbidden cases such as Split Bill with normal user and WorkSpace at the same time

Actual Result:

The CMD+Enter command takes you to the final Split Bill page, which includes normal users and WS at the same time, although this is not allowed by the system

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

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Bug6237291_1697311077086.Recording__528.mp4
MacOS: Desktop

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @garrettmknight

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 14, 2023
  2. melvin-bot commented on Oct 14, 2023

    @melvin-bot

    Triggered auto assignment to @garrettmknight (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  3. melvin-bot commented on Oct 14, 2023

    @melvin-bot

    Bug0 Triage Checklist (Main S/O)

    • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
    • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
      • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
    • This bug is reproducible using the reproduction steps in the OP. S/O
      • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
      • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
    • This issue is filled out as thoroughly and clearly as possible
      • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
    • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync
  4. neonbhai commented on Oct 14, 2023

    @neonbhai
    Contributor

    Proposal

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

    We can bypass Confirm button and navigate via shortcut even though confirm button is not shown.

    What is the root cause of that problem?

    We hide the confirm button when we don't want the user to progress. but we allow the shortcut to navigate without checking this.

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

    We should not navigate further if the confirm button is not on the screen.

    In BaseOptionsSelector, we will check for visibility of the confirm button before executing the onConfirmSelection() callback:

    () => {
    if (this.props.canSelectMultipleOptions) {
    this.props.onConfirmSelection();
    return;
    }

    Implementation:

    • shouldShowFooter is declared in the render block:

      render() {
      const shouldShowFooter =
      !this.props.isReadOnly && (this.props.shouldShowConfirmButton || this.props.footerContent) && !(this.props.canSelectMultipleOptions && _.isEmpty(this.props.selectedOptions));

      We will have to declare it in the constructor to make it available to other functions. Add here:

      this.shouldShowFooter = false;

      And change const shouldShowFooter to this.shouldShowFooter

    • Update all mentions of shouldShowFooter to this.shouldShowFooter

    • Update this line to:

      if (this.props.canSelectMultipleOptions && this.shouldShowFooter) { 
        // only carry out the callback if user can see the confirm button.
        ...
      }               

    This makes sure we don't go to the invalid state of splitting with a workspace.

    Behaviour After Change:
    CTRLEnter still allows selectRow to to be called (equivalent of pressing enter):

    () => {
    if (this.props.canSelectMultipleOptions) {
    this.props.onConfirmSelection();
    return;
    }
    const focusedOption = this.state.allOptions[this.state.focusedIndex];
    if (!focusedOption) {
    return;
    }
    this.selectRow(focusedOption);
    },

    Which means user will go to manual request with the focused option. Same as pressing enter.

    Making sure no regressions:

    OptionsSelector is used in these places

    Screenshot from 2023-10-18 23-06-52

    Option lists that don't have a footer call SelectRow() which is outside the condition we are focusing on.

    We will be blocking onConfirmSelection() that is passed to option lists only when they have a footer. This is in Three Places in the app:

    MoneyRequestConfirmList

    No regressions.

    NewChatPage is also bugging:

    We allow onConfirmSelection to be carried out in NewChatPage also. Which tries to create a chat without selecting participants.
    This results in abrupt navigation to Conceirge (as a fallback).

    Current behaviour on pressing CTRL+Enter on newChat Page:

    Screencast.from.19-10-23.12.07.53.AM.IST.webm

    This bug will also be fixed.

  5. garrettmknight commented on Oct 16, 2023

    @garrettmknight
    Contributor

    Reproduced, opening up.

  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Oct 16, 2023
  7. melvin-bot commented on Oct 16, 2023

    @melvin-bot

    Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.

  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Oct 16, 2023
  9. melvin-bot commented on Oct 16, 2023

    @melvin-bot

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

  10. changed the title [-]Desktop/Web - IOU - CMD+Enter allows you to select users and WS into one Split Bill[/-] [+][$500] Desktop/Web - IOU - CMD+Enter allows you to select users and WS into one Split Bill[/+] on Oct 16, 2023
  11. melvin-bot commented on Oct 16, 2023

    @melvin-bot

    ⚠️ Could not update price automatically because there is no linked Upwork Job ID. The BZ team member will need to update the price manually in Upwork.

  12. hoangzinh commented on Oct 18, 2023

    @hoangzinh
    Contributor

    @neonbhai Thanks for your proposal. Can you check if it won't cause any regression bugs on options lists that don't have a footer?

  13. 55 remaining items

  14. neonbhai commented on Jan 8, 2024

    @neonbhai
    Contributor

    PR ready for review!

  15. pecanoro commented on Jan 15, 2024

    @pecanoro
    Contributor

    @garrettmknight It seems the issue was fixed by another PR when we were about to merge this PR and if I remember correctly, we still should issue payment since this wasn't the contributor's fault. Could you handle it?

  16. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed
    ReviewingHas a PR in review
    on Jan 15, 2024
  17. garrettmknight commented on Jan 16, 2024

    @garrettmknight
    Contributor

    We've issued payment for work that turned out to be unnecessary, historically. I can do that this time, but @neonbhai I'd appreciate a little more urgency getting PRs up in the future. 🙇 Payment offer sent.

  18. garrettmknight commented on Jan 16, 2024

    @garrettmknight
    Contributor

    Paid, closing.

  19. neonbhai commented on Jan 16, 2024

    @neonbhai
    Contributor

    @garrettmknight Thank you!

  20. hoangzinh commented on Jan 16, 2024

    @hoangzinh
    Contributor

    Hi @garrettmknight can you help to issue payment for me as well? I helped review proposals, PR and completed the review check list already.

  21. garrettmknight commented on Jan 17, 2024

    @garrettmknight
    Contributor

    Sorry about that @hoangzinh - offer sent!

  22. hoangzinh commented on Jan 17, 2024

    @hoangzinh
    Contributor

    Accepted. Thanks @garrettmknight

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

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions