Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.47k stars 2.82k forks source link

[$250] [P2P Distance] Tracking distance expense results in "Unexpected error..." #48932

Open m-natarajan opened 1 month ago

m-natarajan commented 1 month ago

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.31-17 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 Expensify/Expensify Issue URL: Issue reported by: @jjcoffee Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1725609946790359

Action Performed:

  1. Go to any workspace chat.
  2. Click + > Track expense > Distance.
  3. Proceed to confirmation page.
  4. Submit the track distance expense.
  5. Go to transaction thread and wait for ~30 seconds for the request(s) to finish sending

    Expected Result:

    Expense submits successfully

    Actual Result:

    After some delay an RBR shows and the error Unexpected error submitting this expense. Please try again later.

    Workaround:

    Unknown

    Platforms:

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

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

Screenshots/Videos

Add any screenshot/video evidence

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021833997737495935264
  • Upwork Job ID: 1833997737495935264
  • Last Price Increase: 2024-10-09
melvin-bot[bot] commented 1 month ago

Triggered auto assignment to @lschurr (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

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

huult commented 3 weeks ago

Proposal

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

Tracking distance expense results in "Unexpected error..."

What is the root cause of that problem?

This is back end issue.

The parameter to the API Track Expense

{"amount":14102662,"currency":"VND","comment":"","created":"2024-09-17","merchant":"5.67 km @ ₫24872.42 / km","chatReportID":"7775485239207649","transactionID":"172693198248884457","reportActionID":"2973467326260508492","createdChatReportActionID":"-1","createdIOUReportActionID":"-1","receipt":{"source":257,"state":"OPEN"},"receiptState":"OPEN","category":"","taxCode":"","taxAmount":0,"billable":false,"transactionThreadReportID":"2440016167003209","createdReportActionIDForThread":"4993591246514933034","waypoints":"{\"waypoint0\":{\"keyForList\":\"33 P. Mạc Thái Tổ_1726587717533\",\"lat\":21.0178799,\"lng\":105.7909807,\"address\":\"33 Phố Mạc Thái Tổ, Yen Hoa, Cầu Giấy, Hanoi, Vietnam\",\"name\":\"33 P. Mạc Thái Tổ\"},\"waypoint1\":{\"keyForList\":\"75 Đ. Phú Diễn_1726587725141\",\"lat\":21.0447846,\"lng\":105.7621923,\"address\":\"75 Nguyễn Chí Thanh, Phú Diễn, Từ Liêm, Hanoi, Vietnam\",\"name\":\"75 Đ. Phú Diễn\"}}","customUnitRateID":"_FAKE_P2P_ID_","actionableWhisperReportActionID":"8760619227993411833"}

This is the response from the API

  "message": "Network request failed",
  "request": {
    "command": "TrackExpense",
    "data": {
      "amount": 26240403,
      "currency": "VND",
      "comment": "",
      "created": "2024-09-17",
      "merchant": "10.55 km @ ₫24872.42 / km",
      "chatReportID": "7775485239207649",
      "transactionID": "6556353588824803763",
      "reportActionID": "8716370151425264846",
      "createdChatReportActionID": "-1",
      "createdIOUReportActionID": "-1",
      "receipt": { "source": 257, "state": "OPEN" },
      "receiptState": "OPEN",
      "category": "",
      "taxCode": "",
      "taxAmount": 0,
      "billable": false,
      "transactionThreadReportID": "924002527595184",
      "createdReportActionIDForThread": "4690389993573524583",
      "waypoints": "{\"waypoint0\":{\"keyForList\":\"75 Đ. Phú Diễn_1726586623144\",\"lat\":21.0447846,\"lng\":105.7621923,\"address\":\"75 Nguyễn Chí Thanh, Phú Diễn, Từ Liêm, Hanoi, Vietnam\",\"name\":\"75 Đ. Phú Diễn\"},\"waypoint1\":{\"keyForList\":\"55B P. Hai Bà Trưng_1726586668888\",\"lat\":21.0265853,\"lng\":105.8442813,\"address\":\"55B Phố Hai Bà Trưng, Cua Nam, Hoàn Kiếm, Hanoi, Vietnam\",\"name\":\"55B P. Hai Bà Trưng\"}}",
      "customUnitRateID": "_FAKE_P2P_ID_",
      "actionableWhisperReportActionID": "1621366869723820916",
      "apiRequestType": "write",
      "pusherSocketID": "777239.36912",
      "shouldRetry": true,
      "canCancel": true
    },
    "successData": [
      {
        "onyxMethod": "merge",
        "key": "reportActions_7775485239207649",
        "value": {
          "1621366869723820916": { "pendingAction": null, "errors": null }
        }
      },
      {
        "onyxMethod": "merge",
        "key": "reportActions_7775485239207649",
        "value": {
          "8716370151425264846": { "pendingAction": null, "errors": null }
        }
      },
      {
        "onyxMethod": "merge",
        "key": "report_924002527595184",
        "value": { "pendingFields": null, "errorFields": null }
      },
      {
        "onyxMethod": "merge",
        "key": "transactions_6556353588824803763",
        "value": {
          "pendingAction": null,
          "pendingFields": { "waypoints": null },
          "routes": null
        }
      },
      {
        "onyxMethod": "merge",
        "key": "reportActions_924002527595184",
        "value": {
          "4690389993573524583": { "pendingAction": null, "errors": null }
        }
      }
    ],
    "failureData": [
      {
        "onyxMethod": "set",
        "key": "reportActions_7775485239207649",
        "value": { "1621366869723820916": {} }
      },
      {
        "onyxMethod": "set",
        "key": "nvp_quickActionGlobalCreate",
        "value": {
          "action": "trackDistance",
          "chatReportID": "7775485239207649",
          "isFirstQuickAction": false
        }
      },
      {
        "onyxMethod": "merge",
        "key": "reportActions_7775485239207649",
        "value": {
          "8716370151425264846": {
            "errors": {
              "1726586676052000": "Unexpected error submitting this expense. Please try again later."
            }
          }
        }
      },
      {
        "onyxMethod": "merge",
        "key": "report_7775485239207649",
        "value": {
          "lastReadTime": "2024-09-17 14:47:51.488",
          "lastMessageText": "tracked ₫388,507 for 15.62 kilometers",
          "lastMessageHtml": "What would you like to do with this expense?"
        }
      },
      {
        "onyxMethod": "merge",
        "key": "report_924002527595184",
        "value": {
          "pendingFields": null,
          "errorFields": {
            "createChat": {
              "1726586676052000": "Unexpected error creating this chat. Please try again later."
            }
          }
        }
      },
      {
        "onyxMethod": "merge",
        "key": "transactions_6556353588824803763",
        "value": {
          "errors": {
            "1726586676052000": "Unexpected error submitting this expense. Please try again later."
          },
          "pendingFields": { "waypoints": null }
        }
      },
      {
        "onyxMethod": "merge",
        "key": "reportActions_924002527595184",
        "value": {
          "4690389993573524583": {
            "errors": {
              "1726586676052000": "Unexpected error submitting this expense. Please try again later."
            }
          }
        }
      }
    ]
  }
}

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

Please double-check the parameters sent from the client to the API to ensure they are correct, and also double-check the logic handling the response errors. Otherwise, Mobile will remove this error from the client and skip it.

melvin-bot[bot] commented 3 weeks ago

@lschurr, @shubham1206agra Eep! 4 days overdue now. Issues have feelings too...

lschurr commented 3 weeks ago

@shubham1206agra can you review the proposal?

shubham1206agra commented 3 weeks ago

@lschurr Theres no proper proposal till yet.

Can you ask someone from internal team to look into this?

melvin-bot[bot] commented 3 weeks ago

📣 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] commented 2 weeks ago

@lschurr, @shubham1206agra Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] commented 2 weeks ago

@lschurr @shubham1206agra this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

melvin-bot[bot] commented 2 weeks ago

Triggered auto assignment to @muttmuure (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

lschurr commented 2 weeks ago

Hi @muttmuure - I'm OOO until Oct 7th. Are you able to help with this one and start a Slack convo or add the Hot Pick label so we can get some help internally?

melvin-bot[bot] commented 2 weeks ago

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

muttmuure commented 2 weeks ago

Will take a look tomorrow

melvin-bot[bot] commented 1 week ago

@muttmuure, @shubham1206agra Eep! 4 days overdue now. Issues have feelings too...

melvin-bot[bot] commented 1 week ago

📣 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] commented 1 week ago

@muttmuure, @shubham1206agra Still overdue 6 days?! Let's take care of this!

shubham1206agra commented 1 week ago

Please take this internal.

🎀👀🎀 C+ reviewed

melvin-bot[bot] commented 1 week ago

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

rafecolton commented 1 week ago

@muttmuure what's the expectation here of me as CME?

melvin-bot[bot] commented 5 days ago

@rafecolton @muttmuure @shubham1206agra this issue is now 4 weeks old, please consider:

Thanks!

melvin-bot[bot] commented 5 days ago

@rafecolton, @muttmuure, @shubham1206agra Eep! 4 days overdue now. Issues have feelings too...

rafecolton commented 5 days ago

@muttmuure bump on https://github.com/Expensify/App/issues/48932#issuecomment-2392681993, asked here in Slack as well

melvin-bot[bot] commented 4 days ago

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

mallenexpensify commented 4 days ago

My take is...

  1. Shubham posts to assign an internal engineer to get feedback to see if the issue is internal or not
  2. @rafecolton 's action, as the engineer, is to confirm if they think the issue is internal or External
    • If External, we wait for proposals (@rafecolton could unassign or stay assigned and add ⭐ to @shubham1206agra as the owner). Issue proceeds as normal.
    • If internal - Rafe and @muttmuure decide if it's a #newdot-quality bug, based on deets in this SO, inc. "unreliable UX (a part of the UI doesn’t load correctly or responds unexpectedly at times but not always), unreliable, excessive, or redundant API requests, and general platform slowness".
    • If it is #newdot-quality, Rafe stays assigned, and he or Matt Mo add to #newdot-quality project.
    • If not, Rafe can stay assigned or unassign.
rafecolton commented 2 days ago

@m-natarajan can you confirm if you are able to reproduce this consistently on android?

mallenexpensify commented 2 days ago

@muttmuure do you have an Android to test? If not, I have a phone at the bank and can do so.

MelvinBot commented 2 days ago

This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989