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

Expense - Unable to drag and drop receipt to Upload receipt RHP #49901

Closed
2 of 6 tasks
lanitochka17 opened this issue Sep 29, 2024 · 15 comments
Closed
2 of 6 tasks

Expense - Unable to drag and drop receipt to Upload receipt RHP #49901

lanitochka17 opened this issue Sep 29, 2024 · 15 comments
Assignees
Labels
Engineering Hourly KSv2 Reviewing Has a PR in review

Comments

@lanitochka17
Copy link

lanitochka17 commented Sep 29, 2024

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.41-2
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): applausetester+kh010901@applause.expensifail.com
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to DM
  3. Submit an expense without receipt
  4. Go to transaction thread
  5. Click on Add receipt modal
  6. Drag and drop an image to the RHP

Expected Result:

Image can be dragged and dropped to Upload receipt RHP

Actual Result:

Image cannot be dragged and dropped to Upload receipt RHP

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

Bug6618334_1727525236867.20240928_200433.mp4

View all open jobs on GitHub

@lanitochka17 lanitochka17 added DeployBlockerCash This issue or pull request should block deployment DeployBlocker Indicates it should block deploying the API labels Sep 29, 2024
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

Copy link

melvin-bot bot commented Sep 29, 2024

Triggered auto assignment to @carlosmiceli (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

@lanitochka17
Copy link
Author

We think that this bug might be related to #wave-control

@ishpaul777
Copy link
Contributor

offending PR #47990

@ishpaul777
Copy link
Contributor

ishpaul777 commented Sep 29, 2024

Edited by proposal-police: This proposal was edited at 2024-09-29 20:15:28 UTC.

Edits: Fix code links, added video

Proposal

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

Unable to drag and drop receipt to Upload receipt RHP

What is the root cause of that problem?

here we are explictly disable the drag and drop functionality when backTo route is not available.

shouldShowWrapper={!!backTo}

in this PR #47990, we replaced getActiveRouteWithoutParams with getReportRHPActiveRoute which return empty string when report is not in RHP.

Navigation.getReportRHPActiveRoute(),

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

Here, If getReportRHPActiveRoute return empty string then we should get the active route from getActiveRouteWithoutParams.

                      Navigation.navigate(
                                ROUTES.MONEY_REQUEST_STEP_SCAN.getRoute(
                                   // rest of params
                                    Navigation.getReportRHPActiveRoute() || Navigation.getActiveRouteWithoutParams(),
                                ),
                            )
Screen.Recording.2024-09-30.at.1.47.38.AM.mov

@Nodebrute
Copy link
Contributor

Nodebrute commented Sep 29, 2024

Edited by proposal-police: This proposal was edited at 2024-09-29 20:25:27 UTC.

Proposal

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

Unable to drag and drop receipt to Upload receipt RHP

What is the root cause of that problem?

We recently started using Navigation.getReportRHPActiveRoute() everywhere, but this issue only happens on Scan page

shouldShowWrapper={!!backTo}

It's because shouldShowWrapper will be false and the top part will be cut off
shouldShowWrapper={!!backTo}

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

We can create a new variable const isEditing = action === CONST.IOU.ACTION.EDIT and we can pass it here

shouldShowWrapper={!!backTo}

            shouldShowWrapper={isEditing}

Optional: We can also fix this in IOURequestStepScan/index.native.tsx file
We should check for other pages too where we have this issue and fix it

What alternative solutions did you explore? (Optional)

Or we can do something like this here

         shouldShowWrapper={!!backTo || isEditing}

Alternative 2
Pass shouldShowWrapper here

 shouldShowWrapper

shouldShowWrapper={!!backTo}

@huult
Copy link
Contributor

huult commented Sep 30, 2024

Proposal

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

Android- expense - In camera screen receipt header is missing

What is the root cause of that problem?

The backTo is undefined, which prevents the wrapper from showing and causes this issue.

shouldShowWrapper={!!backTo}

backTo is undefined because Navigation.getReportRHPActiveRoute() returns undefined when clicked from the money request view.

Navigation.getReportRHPActiveRoute(),

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

We should check if getReportRHPActiveRoute returns undefined, and if so, use getActiveRouteWithoutParams.

// src/components/ReportActionItem/MoneyRequestView.tsx#L538
{shouldShowReceiptEmptyState && (
                    <ReceiptEmptyState
                        hasError={hasErrors}
                        disabled={!canEditReceipt}
                        onPress={() =>
                            Navigation.navigate(
                                ROUTES.MONEY_REQUEST_STEP_SCAN.getRoute(
                                    CONST.IOU.ACTION.EDIT,
                                    iouType,
                                    transaction?.transactionID ?? '-1',
                                    report?.reportID ?? '-1',
-                                    Navigation.getReportRHPActiveRoute(),
+                                    Navigation.getReportRHPActiveRoute() || Navigation.getActiveRouteWithoutParams(),
                                ),
                            )
                        }
                    />
                )}

What alternative solutions did you explore? (Optional)

We used getActiveRouteWithoutParams instead of getReportRHPActiveRoute.

// src/components/ReportActionItem/MoneyRequestView.tsx#L538
{shouldShowReceiptEmptyState && (
                    <ReceiptEmptyState
                        hasError={hasErrors}
                        disabled={!canEditReceipt}
                        onPress={() =>
                            Navigation.navigate(
                                ROUTES.MONEY_REQUEST_STEP_SCAN.getRoute(
                                    CONST.IOU.ACTION.EDIT,
                                    iouType,
                                    transaction?.transactionID ?? '-1',
                                    report?.reportID ?? '-1',
-                                    Navigation.getReportRHPActiveRoute(),
+                                    Navigation.getActiveRouteWithoutParams(),
                                ),
                            )
                        }
                    />
                )}

Note: Same as my proposal posted previously.

POC
  • Screenshot 2024-09-30 at 09 37 57

@Gonals Gonals removed the DeployBlocker Indicates it should block deploying the API label Sep 30, 2024
@Gonals
Copy link
Contributor

Gonals commented Sep 30, 2024

Not a Web-E blocker

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Hourly KSv2 labels Sep 30, 2024
@carlosmiceli carlosmiceli added Hourly KSv2 and removed Weekly KSv2 labels Sep 30, 2024
@carlosmiceli
Copy link
Contributor

I think @bernhardoj already fixed this here? Should I assign you to this one? I don't think this should be weekly btw, I'll change it to Hourly until we confirm this is solved today since it's a rough bug.

Copy link

melvin-bot bot commented Sep 30, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@bernhardoj
Copy link
Contributor

@carlosmiceli yes, I'm fixing it in #49916. Not sure if I need to get assigned here though.

@rayane-djouah
Copy link
Contributor

The linked PR fixes this blocker and is ready for merging and cherry-picking to staging

@carlosmiceli
Copy link
Contributor

Since @luacmartins is reviewing that PR I'll let him decide, should @bernhardoj be assigned to this issue too?

@luacmartins
Copy link
Contributor

Confirmed fix on staging.

@luacmartins
Copy link
Contributor

This was a regression so I'm gonna close the issue.

@luacmartins luacmartins removed the DeployBlockerCash This issue or pull request should block deployment label Sep 30, 2024
@luacmartins luacmartins self-assigned this Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Engineering Hourly KSv2 Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

9 participants