Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 of 6 tasks
lanitochka17 opened this issue Oct 14, 2023 · 46 comments
Closed
2 of 6 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Oct 14, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] 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
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 14, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 14, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 14, 2023

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

@neonbhai
Copy link
Contributor

neonbhai commented Oct 14, 2023

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.

@garrettmknight
Copy link
Contributor

Reproduced, opening up.

@garrettmknight garrettmknight added the External Added to denote the issue can be worked on by a contributor label Oct 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

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

@garrettmknight garrettmknight 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 Oct 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

⚠️ 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.

@hoangzinh
Copy link
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?

@situchan
Copy link
Contributor

This bug will be gone after #27508

@hoangzinh
Copy link
Contributor

@neonbhai I tested your proposal and it didn't work. Can you check your proposal again? Thanks

Screen.Recording.2023-10-18.at.18.48.13.mov

@neonbhai
Copy link
Contributor

@hoangzinh
Copy link
Contributor

@neonbhai thanks for you updating. But I think the expected behavior here should be, if we press CMD+Enter in this case, it should do nothing (or show an error as it's expected in #27508). Because this shortcut would go to the next step if it's a multi-select option.

Btw, before we put more effort into this issue. I'm inclining with @situchan here #29628 (comment). @garrettmknight can you put this issue on holding for #27508?

@melvin-bot melvin-bot bot added the Overdue label Oct 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 23, 2023

@garrettmknight, @hoangzinh Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@garrettmknight garrettmknight changed the title [$500] Desktop/Web - IOU - CMD+Enter allows you to select users and WS into one Split Bill [HOLD for #27508] [$500] Desktop/Web - IOU - CMD+Enter allows you to select users and WS into one Split Bill Oct 23, 2023
@garrettmknight garrettmknight added Weekly KSv2 and removed Daily KSv2 labels Oct 23, 2023
@melvin-bot melvin-bot bot removed the Overdue label Oct 23, 2023
@garrettmknight
Copy link
Contributor

Will keep an eye on #27508

@melvin-bot melvin-bot bot added the Overdue label Nov 1, 2023
@garrettmknight
Copy link
Contributor

Still holding on #27508

@melvin-bot melvin-bot bot added Overdue and removed Help Wanted Apply this label when an issue is open to proposals by contributors labels Jan 2, 2024
@garrettmknight
Copy link
Contributor

@neonbhai all you!

@melvin-bot melvin-bot bot removed the Overdue label Jan 4, 2024
@neonbhai
Copy link
Contributor

neonbhai commented Jan 6, 2024

Raising PR soon!

@melvin-bot melvin-bot bot added the Overdue label Jan 8, 2024
@pecanoro
Copy link
Contributor

pecanoro commented Jan 8, 2024

@neonbhai Friendly reminder to create that PR since it's been a week already 😄

@melvin-bot melvin-bot bot removed the Overdue label Jan 8, 2024
@neonbhai
Copy link
Contributor

neonbhai commented Jan 8, 2024

Raising by EOD!

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jan 8, 2024
@neonbhai
Copy link
Contributor

neonbhai commented Jan 8, 2024

PR ready for review!

@pecanoro
Copy link
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?

@pecanoro pecanoro added Awaiting Payment Auto-added when associated PR is deployed to production and removed Reviewing Has a PR in review labels Jan 15, 2024
@garrettmknight
Copy link
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.

@garrettmknight garrettmknight added Daily KSv2 and removed Weekly KSv2 labels Jan 16, 2024
@garrettmknight
Copy link
Contributor

Paid, closing.

@neonbhai
Copy link
Contributor

@garrettmknight Thank you!

@hoangzinh
Copy link
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.

@pecanoro pecanoro reopened this Jan 17, 2024
@garrettmknight
Copy link
Contributor

Sorry about that @hoangzinh - offer sent!

@hoangzinh
Copy link
Contributor

Accepted. Thanks @garrettmknight

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

7 participants