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

[HOLD for payment 2023-09-07] [$1000] Web - Money Request - Dev - On money request page distance page user is able drag & drop file #25661

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

Comments

@izarutskaya
Copy link

izarutskaya commented Aug 22, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Go to the money request page
  2. Select Distance tab
  3. Drag file to this tab
  4. Notice use is able to drag & drop file on distance page and can request money directly

Expected Result:

User should not be able to drag & drop files directly on Distance tab same as manually tab

Actual Result:

Describe what actually happened

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: v1.3.56-0

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

Notes/Photos/Videos: Any additional supporting documentation

Screen.Recording.2023-08-12.At.1.50.41.Am.1.mp4
Recording.2948.mp4

Expensify/Expensify Issue URL:

Issue reported by: @dhairyasenjaliya

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1691785104348009

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0106fe9a0ed877de3e
  • Upwork Job ID: 1693995295563288576
  • Last Price Increase: 2023-08-22
  • Automatic offers:
    • fedirjh | Reviewer | 26292940
    • dhairyasenjaliya | Contributor | 26292941
    • dhairyasenjaliya | Reporter | 26292942
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 22, 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 Aug 22, 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

@izarutskaya
Copy link
Author

Proposal from @dhairyasenjaliya

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

  • On money request page distance page user is able drag & drop file

What is the root cause of that problem?

  • The root cause is we are using <DragAndDropProvider> component on MoneyRequestSelectorPage which is where all 3 tabs are defined here we have handled disabled drag and drop for the manual tab and not handled for distance tab that makes the user allow drag on that tab

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

option - 1

  • On the below line we can just add one more condition to check if the selected tab is CONST.TAB.DISTANCE then we should pass true on isDisabled props of DragAndDropProvider
isDisabled={props.selectedTab === CONST.TAB.MANUAL || props.selectedTab === CONST.TAB.DISTANCE} // example

<DragAndDropProvider isDisabled={props.selectedTab === CONST.TAB.MANUAL}>

option -2

  • On the below line we can add a condition whereby we enable drag & drop only if the tab selected is CONST.TAB.SCAN I believe only this tab needs to enable the drag & drop functionality
    <DragAndDropProvider isDisabled={props.selectedTab === CONST.TAB.MANUAL}>

What alternative solutions did you explore? (Optional)

  • N/A
    ———————

@garrettmknight garrettmknight added the External Added to denote the issue can be worked on by a contributor label Aug 22, 2023
@melvin-bot melvin-bot bot changed the title Web - Money Request - Dev - On money request page distance page user is able drag & drop file [$1000] Web - Money Request - Dev - On money request page distance page user is able drag & drop file Aug 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 22, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0106fe9a0ed877de3e

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

melvin-bot bot commented Aug 22, 2023

Current assignee @garrettmknight is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Aug 22, 2023

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

@garrettmknight
Copy link
Contributor

Confirmed, seems like odd behavior.

@MaciejSWM
Copy link
Contributor

MaciejSWM commented Aug 23, 2023

+1 to izarutskaya's proposal option 2. Proposal option 2 is better than option 1 since explicit whitelisting instead of blacklisting will prevent exactly this type of errors in the future. There just might be a typo in proposal option 2 as it should be: <DragAndDropProvider isDisabled={props.selectedTab !== CONST.TAB.SCAN}>

@dhairyasenjaliya
Copy link
Contributor

Yeah I just forget to add ! on option 2 BTW I have added that proposal while bug reporting @MaciejSWM

@napster125
Copy link
Contributor

napster125 commented Aug 23, 2023

Proposal

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

On money request page, users can drag and drop files directly on the Distance tab.

What is the root cause of that problem?

The root cause of the problem is that we are not handling all cases except for the scan tab in the MoneyRequestSelectorPage.
The code snippet provided only handles the manual tab.

<DragAndDropProvider isDisabled={props.selectedTab === CONST.TAB.MANUAL}>

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

To solve this problem, we can wrap the ReceiptSelector component with the DragAndDropProvider. This will enable drag and drop functionality specially for the ReceiptSelector component. Additionally, we will need to remove the DragAndDropProvider from the MoneyRequestSelectorPage to avoid redundant drag and drop functionality.

return (
<View style={[styles.uploadReceiptView(isSmallScreenWidth)]}>

return (
  <DragAndDropProvider>
    /* ... */
  </DragAndDropProvider>
)

What alternative solutions did you explore? (Optional)

<DragAndDropProvider isDisabled={props.selectedTab === CONST.TAB.MANUAL}>

<DragAndDropProvider isDisabled={props.selectedTab !== CONST.TAB.SCAN}>

However, this option has some drawbacks.
Firstly, if we build the Android or iOS app, drag and drop functionality is unnecessary and redundant, making the DragAndDropProvider unnecessary as well.
Secondly, if there are additional tabs added in the future, we would need to add disable logic.
Lastly, when dragging a file, the right-hand navigation (RHN) is covered by the active color. It might be better to only cover the tab content rather than the entire RHN component.

@melvin-bot
Copy link

melvin-bot bot commented Aug 23, 2023

📣 @napster125! 📣
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. 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.
  2. 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.
  3. 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>

@melvin-bot
Copy link

melvin-bot bot commented Aug 23, 2023

⚠️ Invalid email. Please make sure to create an Expensify account with this email first here.

@napster125
Copy link
Contributor

Contributor details
Your Expensify account email: napster0125@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~01212c68bbcaede4db

@melvin-bot
Copy link

melvin-bot bot commented Aug 23, 2023

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@fedirjh
Copy link
Contributor

fedirjh commented Aug 23, 2023

@dhairyasenjaliya Proposal (2nd option) looks good to me.


@napster125 Your solution will break the expected behavior in this test

Verify the drag and drop functionality works for the whole right hand menu


Firstly, if we build the Android or iOS app, drag and drop functionality is unnecessary and redundant, making the DragAndDropProvider unnecessary as well.

Hmmm, this is the code for the native, we just return children

function DragAndDropProvider({children}) {
return children;
}

Secondly, if there are additional tabs added in the future, we would need to add disable logic.

When we implement new tab that need the drag-and-drop, then we should enable it.

Lastly, when dragging a file, the right-hand navigation (RHN) is covered by the active color.

This is the expected behavior as I already mentioned.

@dhairyasenjaliya
Copy link
Contributor

hm @fedirjh I believe Melvin didn't assign an internal member for review perhaps any issue on above template ?

@fedirjh
Copy link
Contributor

fedirjh commented Aug 23, 2023

Melvin didn't assign an internal

Yeah missed adding the tag


Let's proceed with @dhairyasenjaliya Proposal (2nd option).

🎀 👀 🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Aug 23, 2023

Triggered auto assignment to @yuwenmemon, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 23, 2023

📣 @fedirjh 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@melvin-bot
Copy link

melvin-bot bot commented Aug 23, 2023

📣 @dhairyasenjaliya 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 Weekly KSv2 labels Aug 23, 2023
@dhairyasenjaliya
Copy link
Contributor

@fedirjh PR ready for review

@kaushiktd
Copy link
Contributor

https://drive.google.com/file/d/1gfn-AYSfXMfu5bQ-J73MoJOqtVDPD79U/view?usp=sharing

Has anything changed lately? When I directly try this URL
https://localhost:8082/request/new/distance

It redirects me to this address
https://localhost:8082/request/new

See the issue image,
Screenshot 2023-08-28 at 11 51 05 AM

There are three tabs present but in my video there is none.

Is this happening with someone else here?

@dhairyasenjaliya
Copy link
Contributor

@kaushiktd This feature is in beta it will not be accessed until the release

@fedirjh
Copy link
Contributor

fedirjh commented Aug 28, 2023

@kaushiktd You should enable this beta from the permissions.js file.

@melvin-bot
Copy link

melvin-bot bot commented Aug 28, 2023

🎯 ⚡️ Woah @fedirjh / @dhairyasenjaliya, great job pushing this forwards! ⚡️

The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @dhairyasenjaliya got assigned: 2023-08-23 20:50:30 Z
  • when the PR got merged: 2023-08-28 19:13:04 UTC

On to the next one 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Aug 31, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Web - Money Request - Dev - On money request page distance page user is able drag & drop file [HOLD for payment 2023-09-07] [$1000] Web - Money Request - Dev - On money request page distance page user is able drag & drop file Aug 31, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Aug 31, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 31, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 31, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.59-5 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 2023-09-07. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Aug 31, 2023

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:

  • [@fedirjh] The PR that introduced the bug has been identified. Link to the PR:
  • [@fedirjh] 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:
  • [@fedirjh] 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:
  • [@fedirjh] Determine if we should create a regression test for this bug.
  • [@fedirjh] 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.
  • [@garrettmknight] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@garrettmknight garrettmknight added Daily KSv2 and removed Weekly KSv2 labels Sep 7, 2023
@fedirjh
Copy link
Contributor

fedirjh commented Sep 8, 2023

BugZero Checklist:


Regression Test Proposal

  1. Open App
  2. Navigate to the money request page
  3. Select the Distance tab
  4. Drag any file to this tab
  5. Verify that the user can't drag & drop a file on the distance page
  • Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added the Overdue label Sep 11, 2023
@garrettmknight
Copy link
Contributor

garrettmknight commented Sep 11, 2023

Summary of payments

@melvin-bot melvin-bot bot removed the Overdue label Sep 11, 2023
@garrettmknight
Copy link
Contributor

@dhairyasenjaliya just realized that we didn't generate a contract for reporting. I just sent you another offer and will pay the $250 once you accept.

@dhairyasenjaliya
Copy link
Contributor

done @garrettmknight I think there was previous contract but will cancel that

@garrettmknight
Copy link
Contributor

Paid and canceled the duplicate contract.

@dhairyasenjaliya
Copy link
Contributor

@garrettmknight can you please close the contract as well thanx

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 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

8 participants