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] hmm it's not there page displayed for offline distance expense when going back online #30319

Closed
6 tasks done
kavimuru opened this issue Oct 25, 2023 · 32 comments
Closed
6 tasks done
Assignees
Labels
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 Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@kavimuru
Copy link

kavimuru commented Oct 25, 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!


Version Number: 1.3.90-1
Reproducible in staging?: y
Reproducible in production?: n
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:

  1. Create a distance expense in offline
  2. Go online and open distance expense details

Expected Result:

The distance expense is not greyed out, the map loads and displays the trip road
and the details of the miles and amount are displayed

Actual Result:

Map doesn't load and amount not updated. hmm it's not there page displayed

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 (Video added)
  • MacOS: Desktop

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Bug6249546_1698192474302.Recording__1635.mp4
MacOS: Desktop

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~010b86585a91287a44
  • Upwork Job ID: 1716971073774956544
  • Last Price Increase: 2023-12-05
@kavimuru kavimuru added DeployBlockerCash This issue or pull request should block deployment External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 25, 2023
@melvin-bot melvin-bot bot changed the title hmm it's not there page displayed for offline distance expense when going back online [$500] hmm it's not there page displayed for offline distance expense when going back online Oct 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 25, 2023

Job added to Upwork: https://www.upwork.com/jobs/~010b86585a91287a44

@melvin-bot
Copy link

melvin-bot bot commented Oct 25, 2023

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

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

melvin-bot bot commented Oct 25, 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

@melvin-bot
Copy link

melvin-bot bot commented Oct 25, 2023

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

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 25, 2023

Triggered auto assignment to @hayata-suenaga (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@hayata-suenaga
Copy link
Contributor

@parasharrajat do you have any idea why this is happening? anyway, I don't think this doesn't have to be a deploy blocker. Removing the label.

@hayata-suenaga hayata-suenaga added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Oct 25, 2023
@arosiclair
Copy link
Contributor

I don't think this doesn't have to be a deploy blocker.

Why not? Is this not a regression?

@melvin-bot melvin-bot bot added the Overdue label Oct 27, 2023
@hayata-suenaga
Copy link
Contributor

ah I should have treated this as a regression in the hindsight. We can get contributors working on this as soon as possible

@melvin-bot melvin-bot bot removed the Overdue label Oct 27, 2023
@suneox
Copy link
Contributor

suneox commented Oct 27, 2023

Proposal

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

hmm it's not there page displayed for offline distance expense when going back online

What is the root cause of that problem?

This issue happen by optimize PR onViewableItemsChanged should receive a reference function or using a viewabilityConfigCallbackPairs due to the callback fail when changing onViewableItems on the fly is not supported

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

Revert optimize for this component to

  const updatePage = useRef(
    ......
  )

What alternative solutions did you explore? (Optional)

we can using viewabilityConfigCallbackPairs and keep useCallback for updatePage

+ const viewabilityConfigCallbackPairs = useRef([{onViewableItemsChanged: updatePage}]);
  ...

replace onViewableItemsChanged to

-  onViewableItemsChanged={updatePage}
+  viewabilityConfigCallbackPairs={viewabilityConfigCallbackPairs}

@situchan
Copy link
Contributor

@suneox I think you submitted proposal on wrong issue. This is not about attachment carousel.

@suneox
Copy link
Contributor

suneox commented Oct 27, 2023

@situchan The action performed is short so I missed steps reproduce let me check again.
Additional info, currently on the latest main branch when visiting an attachment carousel from a distance request also crashed

@melvin-bot melvin-bot bot added the Overdue label Oct 30, 2023
@hayata-suenaga
Copy link
Contributor

still accepting and reviewing proposals

@melvin-bot melvin-bot bot removed the Overdue label Oct 30, 2023
Copy link

melvin-bot bot commented Nov 1, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@hayata-suenaga
Copy link
Contributor

melvin, I posted a message about this issue in the open source channel

@melvin-bot melvin-bot bot added the Overdue label Nov 6, 2023
@CortneyOfstad
Copy link
Contributor

@hayata-suenaga any updates? Thanks!

@melvin-bot melvin-bot bot removed the Overdue label Nov 6, 2023
@hayata-suenaga
Copy link
Contributor

asking for more proposals here

@Tony-MK
Copy link
Contributor

Tony-MK commented Nov 7, 2023

@hayata-suenaga @parasharrajat, and @kavimuru This looks like an interesting issue to solve.
However, I have repeatedly failed to reproduce this bug.
Can one of you kindly help me elaborate on the steps to reproduce?
Is it only reproducible with expensyfail.com accounts?
Thank you 😄

@hayata-suenaga
Copy link
Contributor

Another contributor also cannot reproduce the issue. We can close this for now.

@lanitochka17
Copy link

Issue reproducible in the latest build 1.4.8-0

Hmm.it.s.not.here.appears.when.open.error.report.twice.mp4

@lanitochka17 lanitochka17 reopened this Dec 5, 2023
Copy link

melvin-bot bot commented Dec 5, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@parasharrajat
Copy link
Member

Old proposals do not solve it. Waiting for more.

@paultsimura
Copy link
Contributor

This is a BE issue. Such a behavior is caused by entering an invalid waypoint – "DA".

When sending the request, we create a lot of things optimistically, including the IOU reports:

{
"optimisticData": [
    {
      "onyxMethod": "merge",
      "key": "report_5487289644998116",
      "value": {
        "reportID": "5487289644998116",
        "reportName": "",
        "type": "chat",
        "chatType": "policyExpenseChat",
        "ownerAccountID": 15949930,
        "managerID": 0,
        "policyID": "6E1D1AC5C496E308",
        "participantAccountIDs": [
          15949930
        ],
        "visibleChatMemberAccountIDs": [
          15949930
        ],
        "isPinned": true,
        "lastReadTime": "2023-12-05 18:23:38.808",
        "lastReadSequenceNumber": 0,
        "lastVisibleActionCreated": "2023-12-05 18:09:59.830",
        "lastVisibleActionLastModified": "2023-12-05 18:09:59.830",
        "lastMessageText": "paid $91.10 elsewhere",
        "lastActorAccountID": 15949930,
        "notificationPreference": "always",
        "welcomeMessage": "",
        "stateNum": 0,
        "statusNum": 0,
        "oldPolicyName": "",
        "isOwnPolicyExpenseChat": true,
        "lastMessageHtml": "paid $91.10 elsewhere",
        "hasOutstandingIOU": false,
        "hasOutstandingChildRequest": false,
        "writeCapability": "all",
        "total": 0,
        "currency": "USD",
        "submitterPayPalMeAddress": "",
        "isWaitingOnBankAccount": false,
        "nonReimbursableTotal": 0,
        "isCancelledIOU": false,
        "hasDraft": false,
        "errorFields": {},
        "isOptimisticReport": false,
        "maxSequenceNumber": 5,
        "lastMessageTranslationKey": "",
        "pendingFields": {},
        "iouReportID": "3999330187103665"
      }
    },
    {
      "onyxMethod": "set",
      "key": "report_3999330187103665",
      "value": {
        "reportID": "3999330187103665",
        "chatReportID": "5487289644998116",
        "policyID": "6E1D1AC5C496E308",
        "type": "expense",
        "ownerAccountID": 15949930,
        "hasOutstandingIOU": true,
        "currency": "USD",
        "reportName": "c_workspace owes -PLN 0.00",
        "state": "SUBMITTED",
        "stateNum": 1,
        "statusNum": 1,
        "total": 0,
        "notificationPreference": "hidden",
        "parentReportID": "5487289644998116",
        "parentReportActionID": "1273075035931699602",
        "lastMessageText": "requested PLN 0.00",
        "lastMessageHtml": "requested PLN 0.00",
        "pendingFields": {
          "createChat": "add"
        }
      }
    },
    {
      "onyxMethod": "set",
      "key": "transactions_4091434148729559362",
      "value": {
        "transactionID": "4091434148729559362",
        "amount": 0,
        "currency": "PLN",
        "reportID": "3999330187103665",
        "comment": {
          "type": "customUnit",
          "customUnit": {
            "name": "Distance"
          },
          "waypoints": {
            "waypoint0": {
              "address": "DA"
            },
            "waypoint1": {
              "address": "SF"
            }
          }
        },
        "merchant": "TBD miles @ TBD / mile",
        "created": "2023-12-05",
        "pendingAction": "add",
        "receipt": {
          "source": "/1b96fa279dcd8a80ee9f.png",
          "state": "OPEN"
        },
        "filename": "",
        "category": "",
        "tag": "",
        "billable": false,
        "pendingFields": {
          "waypoints": "add"
        },
        "errorFields": {},
        "routes": {
          "route0": {
            "geometry": {}
          }
        }
      }
    },
    {
      "onyxMethod": "merge",
      "key": "reportActions_5487289644998116",
      "value": {
        "1273075035931699602": {
          "reportActionID": "1273075035931699602",
          "reportID": "5487289644998116",
          "actionName": "REPORTPREVIEW",
          "pendingAction": "add",
          "originalMessage": {
            "linkedReportID": "3999330187103665"
          },
          "message": [
            {
              "html": "c_workspace owes $0.00",
              "text": "c_workspace owes $0.00",
              "isEdited": false,
              "type": "COMMENT"
            }
          ],
          "created": "2023-12-05 18:23:38.808",
          "accountID": 0,
          "actorAccountID": 15949930,
          "childMoneyRequestCount": 1,
          "childLastMoneyRequestComment": "",
          "childRecentReceiptTransactionIDs": {
            "4091434148729559362": "2023-12-05 18:23:38.808"
          },
          "whisperedToAccountIDs": []
        }
      }
    },
    {
      "onyxMethod": "set",
      "key": "reportActions_3999330187103665",
      "value": {
        "3624058654240756897": {
          "reportActionID": "3624058654240756897",
          "actionName": "CREATED",
          "pendingAction": "add",
          "actorAccountID": 15949930,
          "message": [
            {
              "type": "TEXT",
              "style": "strong",
              "text": "paultsimura+c@gmail.com"
            },
            {
              "type": "TEXT",
              "style": "normal",
              "text": " created this report"
            }
          ],
          "person": [
            {
              "type": "TEXT",
              "style": "strong",
              "text": "user_c"
            }
          ],
          "automatic": false,
          "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/37af5896a824b04b4875adff116387b6f7e48612_128.jpeg",
          "created": "2023-12-05 18:23:38.806",
          "shouldShow": true
        },
        "4866323672837689366": {
          "actionName": "IOU",
          "actorAccountID": 15949930,
          "automatic": false,
          "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/37af5896a824b04b4875adff116387b6f7e48612_128.jpeg",
          "isAttachment": false,
          "originalMessage": {
            "amount": 0,
            "comment": "",
            "currency": "PLN",
            "IOUTransactionID": "4091434148729559362",
            "IOUReportID": "3999330187103665",
            "type": "create"
          },
          "message": [
            {
              "html": "requested PLN 0.00",
              "text": "requested PLN 0.00",
              "isEdited": false,
              "type": "COMMENT"
            }
          ],
          "person": [
            {
              "style": "strong",
              "text": "user_c",
              "type": "TEXT"
            }
          ],
          "reportActionID": "4866323672837689366",
          "shouldShow": true,
          "created": "2023-12-05 18:23:38.807",
          "pendingAction": "add",
          "whisperedToAccountIDs": []
        }
      }
    }
  ]
}

When coming back online, the request fails and returns the following Onyx data:

[
  {
    "onyxMethod": "merge",
    "key": "transactions_4091434148729559362",
    "value": {
      "errorFields": {
        "route": {
          "1701800688836019": "Please select a valid waypoint."
        }
      }
    }
  }
]

So the reports are not created in the BE. After clicking on the expense, the OpenReport request is sent to the BE, which returns removal of the report, because it was not created in the BE:

[
  {
    "onyxMethod": "set",
    "key": "report_3999330187103665",
    "value": null
  }
]

Therefore the operation results in opening the Not Found page.
The BE should be fixed to return not only a transaction entity, but also the combination of the optimistic & failure data, so the report gets created in the BE similar to our offline flow.

@parasharrajat
Copy link
Member

Hmm... There should be an RBR error which is already present. Now opening a non-existing report will return null as it does from OpenReport Api.

I think we should change the flow a bit here to manage this state. We could prevent the opening of the Expense Request when there is an RBR on the action level.

Things to check:

  1. What is the behavior when there is an error for subfields on request(Merchant, category etc)? is the RBR shown on action level?

@melvin-bot melvin-bot bot added the Overdue label Dec 8, 2023
@CortneyOfstad
Copy link
Contributor

Not overdue

@melvin-bot melvin-bot bot removed the Overdue label Dec 8, 2023
@hayata-suenaga
Copy link
Contributor

@parasharrajat are we still accepting proposals?

@melvin-bot melvin-bot bot added the Overdue label Dec 11, 2023
@CortneyOfstad
Copy link
Contributor

@parasharrajat bump ^^^ thanks!

@melvin-bot melvin-bot bot removed the Overdue label Dec 11, 2023
@parasharrajat
Copy link
Member

parasharrajat commented Dec 12, 2023

Yes, but I need to confirm if this is a BE issue then it needs to be internal. I will post the update today.

@CortneyOfstad
Copy link
Contributor

Hey! Sorry for the confusion here, but we just got an internal update. Per this post, we can close any bugs that are not related to Waves, so closing this out 👍 We will re-address once the waves are completed.

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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 Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests