Invoice - Creating invoice display unexpected error
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: v9.0.30-9 Reproducible in staging?: Y Reproducible in production?: Y Issue reported by: Applause Internal Team
Action Performed:
- Launch app
- Tap fab-- new workspace
- 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:
- [x] Android: Native
- [x] Android: mWeb Chrome
- [ ] iOS: Native
- [ ] iOS: mWeb Safari
- [x] MacOS: Chrome / Safari
- [x] MacOS: Desktop
Screenshots/Videos
https://github.com/user-attachments/assets/bbc89d88-585b-4d58-8791-8727fabac225
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.
@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
BE error, Onyx data
{
"jsonCode": 402,
"message": "402 missing companyName or companyWebsite",
"onyxData": [],
"requestID": "8bee463eb9014856-BOM"
}
@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?
Cristi is on parental leave so I will take this over.
There are still a couple of issues related to invoicing creation on the main which I can see:
- 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
- API doesn't return
invoiceinformation inside policy forOpenAppAPI 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
@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.
Reviewing label has been removed, please complete the "BugZero Checklist".
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:
- https://github.com/Expensify/App/pull/48935
If no regressions arise, payment will be issued on 2024-09-18. :confetti_ball:
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:
- [ ] [@rlinoz] The PR that introduced the bug has been identified. Link to the PR:
- [ ] [@rlinoz] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
- [ ] [@rlinoz] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
- [ ] [@rlinoz] Determine if we should create a regression test for this bug.
- [ ] [@rlinoz] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
- [ ] [@adelekennedy] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
@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?
@VickyStash my bad we actually show a RBR, but there is not much context to what happened.
Here are the steps:
- Start the send invoice flow for the first time
- Input fake data for the company, like test and https://test.com
- 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"
}
- Try to send a new invoice to someone
- 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
@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:
Let me know if we need to change anything. cc @madmax330
Yeah, that looks good to me
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.
I believe we can close this one.