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.52k stars 2.87k forks source link

[HOLD for payment 2024-09-18] Invoice - Creating invoice display unexpected error #48701

Closed IuliiaHerets closed 1 month ago

IuliiaHerets 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: v9.0.30-9 Reproducible in staging?: Y Reproducible in production?: Y Issue reported by: Applause Internal Team

Action Performed:

  1. Launch app
  2. Tap fab-- new workspace
  3. Tap fab -- send invoice selecting a user

Expected Result:

Creating invoice must not display unexpected error.

Actual Result:

Creating invoice display unexpected error.

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/bbc89d88-585b-4d58-8791-8727fabac225

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @adelekennedy
melvin-bot[bot] commented 1 month ago

Triggered auto assignment to @adelekennedy (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.

IuliiaHerets commented 1 month ago

@adelekennedy FYI 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

ChavdaSachin commented 1 month ago

BE error, Onyx data

{
    "jsonCode": 402,
    "message": "402 missing companyName or companyWebsite",
    "onyxData": [],
    "requestID": "8bee463eb9014856-BOM"
}
adelekennedy commented 1 month ago

@cristipaval adding you here for a quick check - I can reproduce this and this seems like something we should address ASAP - is this being addressed anywhere else?

rlinoz commented 1 month ago

Cristi is on parental leave so I will take this over.

VickyStash commented 1 month ago

There are still a couple of issues related to invoicing creation on the main which I can see: 1) The user can send the invoice even from the workspace where invoicing feature is disabled. It should be fixed with this PR, but I'm waiting for API fixes to open the PR for the review.

https://github.com/user-attachments/assets/a8872eaa-6ab1-48dc-bbd3-3abe64673698

2) API doesn't return invoice information inside policy for OpenApp API call. It makes the app ask a user about the Company name and Company website every time the user re-login the app and tries to send the invoice.

cc @madmax330

rlinoz commented 1 month ago

@VickyStash I would add to the above list that if you use a fake URL the API will return an error but we are not displaying that anywhere and we are not clearing the onyx data.

melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.31-26 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-09-18. :confetti_ball:

melvin-bot[bot] commented 1 month ago

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:

VickyStash commented 1 month ago

@VickyStash I would add to the above list that if you use a fake URL the API will return an error but we are not displaying that anywhere and we are not clearing the onyx data.

@rlinoz Could you please provide more exact steps to reproduce it?

rlinoz commented 1 month ago

@VickyStash my bad we actually show a RBR, but there is not much context to what happened.

Here are the steps:

  1. Start the send invoice flow for the first time
  2. Input fake data for the company, like test and https://test.com
  3. Verify the backend response for SendInvoice is something like:
    {
    "jsonCode": 507,
    "message": "507 Stripe error 'invalid_request_error': Not a valid URL",
    "additionalData": {
    "errorMessage": "Not a valid URL",
    "errorType": "invalid_request_error"
    },
    "onyxData": [],
    "requestID": "8c207d0978f14e0b-SOD"
    }
  4. Try to send a new invoice to someone
  5. Verify the screen to fill company data doesn't show up and now you get the following erro:
    {
    "jsonCode": 402,
    "message": "402 missing companyName or companyWebsite",
    "onyxData": [],
    "requestID": "8c207d67af8c4e0b-SOD"
    }

https://github.com/user-attachments/assets/c660f35c-973c-465f-8d0e-6ec841f5e3ea

VickyStash commented 1 month ago

@rlinoz I've fixed the failure data so now the company name and website will be cleared out if the response was unsuccessful. That's how it looks:

https://github.com/user-attachments/assets/824ae465-f701-4e35-a964-733ac0deafe4

Errors:

Error1 error2

Let me know if we need to change anything. cc @madmax330

rlinoz commented 1 month ago

Yeah, that looks good to me

melvin-bot[bot] commented 1 month ago

Skipping the payment summary for this issue since all the assignees are employees or vendors. If this is incorrect, please manually add the payment summary SO.

rlinoz commented 1 month ago

I believe we can close this one.