App icon indicating copy to clipboard operation
App copied to clipboard

[$250] IOU - RBR is present in LHN but no error msg in combined report when deleting paid IOU offline

Open izarutskaya opened this issue 10 months ago β€’ 19 comments

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.4.60-5 Reproducible in staging?: Y Reproducible in production?: N If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4476117 Logs: https://stackoverflow.com/c/expensify/questions/4856 Issue reported by: Applause-Internal team

Action Performed:

Precondition:

  • User A and have no unsettled IOU.
  1. Go to staging.new.expensify.com
  2. [User A] Request money from User B.
  3. [User A] Go offline.
  4. [User B] Pay the request.
  5. [User A] Delete the request while offline.
  6. [User A] Go online.
  7. [User A] Go to transaction thread (one report view).

Expected Result:

The error "Unexpected error deleting the money request, please try again later" should be present in one transaction report view.

Actual Result:

There is RBR for one transaction report in LHN, but there is no error in the report itself. This issue happens when there is only one request.

Workaround:

Unknown

Platforms:

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

  • [x] Android: Native
  • [x] Android: mWeb Chrome
  • [x] iOS: Native
  • [x] iOS: mWeb Safari
  • [x] MacOS: Chrome / Safari
  • [x] MacOS: Desktop

Screenshots/Videos

https://github.com/Expensify/App/assets/115492554/60b740d3-c949-4693-bcb7-20b1a4201b18

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ebfa7c151ee18ff6
  • Upwork Job ID: 1776224622646538240
  • Last Price Increase: 2024-04-12

izarutskaya avatar Apr 05 '24 09:04 izarutskaya

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

melvin-bot[bot] avatar Apr 05 '24 09:04 melvin-bot[bot]

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

melvin-bot[bot] avatar Apr 05 '24 09:04 melvin-bot[bot]

:wave: 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.

github-actions[bot] avatar Apr 05 '24 09:04 github-actions[bot]

@alexpensify 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.

izarutskaya avatar Apr 05 '24 09:04 izarutskaya

We think this issue might be related to the #collect project.

izarutskaya avatar Apr 05 '24 09:04 izarutskaya

Production

https://github.com/Expensify/App/assets/115492554/337c352e-d4ad-4b8c-a074-406a7deca616

izarutskaya avatar Apr 05 '24 09:04 izarutskaya

This is a specific and rare flow so I dont think we have to hold the deploy on this one.

This is related to the combined view cc @NikkiWines

I think we can make this external

mountiny avatar Apr 05 '24 12:04 mountiny

Job added to Upwork: https://www.upwork.com/jobs/~01ebfa7c151ee18ff6

melvin-bot[bot] avatar Apr 05 '24 12:04 melvin-bot[bot]

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

melvin-bot[bot] avatar Apr 05 '24 12:04 melvin-bot[bot]

Proposal

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

IOU - RBR is present in LHN but no error msg in combined report when deleting paid IOU offline.

What is the root cause of that problem?

When a receipt error occurs, it will be logged within the parentReportAction of the transaction. Consequently, it will only be visible in the IOU report and not in the money request view.

With the recent introduction of the single transaction view, in scenarios involving only one money request, there won't be an IOU report generated. Therefore, any receipt errors and prompts to download associated files will not be displayed.

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

Add Below mention code here

let errors = transaction?.errors ?? {};
if (parentReportAction?.errors) {
    errors = {
        ...errors,
        ...parentReportAction?.errors
    }
}

To get the receipt error from the parentReportAction, we'll add to current error list to show here. As well as, Add condition (showMapAsImage || hasReceipt) || errors inside OfflineWithFeedback component to show or hide image component for expense image.

{(showMapAsImage || hasReceipt) || errors && (

and replace line# 266 with below code:

errors={errors}

Video:

https://drive.google.com/file/d/1L8UHfYOTKoEBsSxGtQ_aZSGoFZ4mS5wy/view?usp=sharing

kaushiktd avatar Apr 05 '24 15:04 kaushiktd

@abdulrahuman5196 when you get a chance, can you review the proposals here? Thanks!

alexpensify avatar Apr 05 '24 22:04 alexpensify

Hi, Will check on the proposals today

abdulrahuman5196 avatar Apr 08 '24 17:04 abdulrahuman5196

Checking now

abdulrahuman5196 avatar Apr 09 '24 20:04 abdulrahuman5196

On first glance, the proposal here https://github.com/Expensify/App/issues/39689#issuecomment-2040156570 makes sense. I will do further testing and comeback with updates

abdulrahuman5196 avatar Apr 09 '24 20:04 abdulrahuman5196

Thank you @abdulrahuman5196, keep us posted.

alexpensify avatar Apr 11 '24 00:04 alexpensify

πŸ“£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πŸ’Έ

melvin-bot[bot] avatar Apr 12 '24 16:04 melvin-bot[bot]

Checking now

abdulrahuman5196 avatar Apr 12 '24 16:04 abdulrahuman5196

@kaushiktd I tested your proposed changes

But it is adding some image frame above the error. I think its from OfflineFeedback, kindly take a look into it.

Screenshot 2024-04-13 at 1 07 07β€―AM

Code I used for reference

--- a/src/components/ReportActionItem/MoneyRequestView.tsx
+++ b/src/components/ReportActionItem/MoneyRequestView.tsx
@@ -255,15 +255,23 @@ function MoneyRequestView({
         [transactionAmount, isSettled, isCancelled, isPolicyExpenseChat, isEmptyMerchant, transactionDate, hasErrors, canUseViolations, hasViolations, translate, getViolationsForField],
     );
 
+    let errors = transaction?.errors ?? {};
+if (parentReportAction?.errors) {
+    errors = {
+        ...errors,
+        ...parentReportAction?.errors
+    }
+}
+
     return (
         <View style={[StyleUtils.getReportWelcomeContainerStyle(isSmallScreenWidth, true, shouldShowAnimatedBackground)]}>
             {shouldShowAnimatedBackground && <AnimatedEmptyStateBackground />}
             <View style={shouldShowAnimatedBackground && [StyleUtils.getReportWelcomeTopMarginStyle(isSmallScreenWidth, true)]}>
                 {/* eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing */}
-                {(showMapAsImage || hasReceipt) && (
+                {(showMapAsImage || hasReceipt) || errors && (
                     <OfflineWithFeedback
                         pendingAction={pendingAction}
-                        errors={transaction?.errors}
+                        errors={errors}
                         errorRowStyles={[styles.ml4]}
                         onClose={() => {

abdulrahuman5196 avatar Apr 12 '24 19:04 abdulrahuman5196

@abdulrahuman5196 You need to enclose View component inside OfflineWithFeedback on below mentioned condition here,

src/components/ReportActionItem/MoneyRequestView.tsx#L275

{(showMapAsImage || hasReceipt) &&
 <View>
</View>
}

This will prevent rendering an empty image box on the report thread.

kaushiktd avatar Apr 13 '24 03:04 kaushiktd

@kaushiktd 's proposal here https://github.com/Expensify/App/issues/39689#issuecomment-2040156570 looks good and works well.

πŸŽ€ πŸ‘€ πŸŽ€ C+ Reviewed

abdulrahuman5196 avatar Apr 15 '24 18:04 abdulrahuman5196

Current assignee @madmax330 is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

melvin-bot[bot] avatar Apr 15 '24 18:04 melvin-bot[bot]

Heads up, I will be offline until Tuesday, April 23, 2024, and will not actively watch over this GitHub during that period.

If anything urgent is needed here, please ask for help in the #expensify-open-source Slack Room-- thanks!

alexpensify avatar Apr 17 '24 21:04 alexpensify

@abdulrahuman5196 any update so far?

kaushiktd avatar Apr 18 '24 02:04 kaushiktd

Bump for @madmax330 to review.

abdulrahuman5196 avatar Apr 18 '24 03:04 abdulrahuman5196

πŸ“£ @abdulrahuman5196 πŸŽ‰ 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[bot] avatar Apr 18 '24 09:04 melvin-bot[bot]

❌ There was an error making the offer to @kaushiktd for the Contributor role. The BZ member will need to manually hire the contributor.

melvin-bot[bot] avatar Apr 18 '24 09:04 melvin-bot[bot]

@abdulrahuman5196 PR submitted

kaushiktd avatar Apr 18 '24 15:04 kaushiktd

Weekly Update: The PR is moving along through the review process.

alexpensify avatar Apr 26 '24 21:04 alexpensify

Weekly Update: The PR is going through a recent round of reviews.

alexpensify avatar May 03 '24 17:05 alexpensify

Weekly Update: The PR is under the last reviews

alexpensify avatar May 13 '24 21:05 alexpensify