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.34k stars 2.77k forks source link

[$250 BLOCKED BY #44388] Send invoice - Invoice report appears broken #44992

Open lanitochka17 opened 2 months ago

lanitochka17 commented 2 months 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.5-4 Reproducible in staging?: Y Reproducible in production?: N Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to FAB > Send invoice
  3. Enter amount and select a receiver
  4. Enter merchant and send the invoice
  5. In invoice chat, click on the preview

Expected Result:

The invoice report will not appear broken

Actual Result:

The invoice report appears broken

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/78819774/ea501c6f-81fd-47f3-9ccf-dc7c7c570d2a

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~011040101d9617db1c
  • Upwork Job ID: 1810478196050638059
  • Last Price Increase: 2024-07-09
Issue OwnerCurrent Issue Owner: @akinwale
melvin-bot[bot] commented 2 months ago

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

github-actions[bot] commented 2 months ago

: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.
lanitochka17 commented 2 months ago

@carlosmiceli 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

carlosmiceli commented 2 months ago

Looking into it now.

carlosmiceli commented 2 months ago

I think this is the culprit: https://github.com/Expensify/App/pull/44529

carlosmiceli commented 2 months ago

Mmmm maybe not.

carlosmiceli commented 2 months ago

Can't figure out yet which PR may be the culprit, but can confirm that it's a FE issue, so I'll add the External label for now to see if we get proposals.

melvin-bot[bot] commented 2 months ago

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

melvin-bot[bot] commented 2 months ago

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

carlosmiceli commented 2 months ago

This one could also be related: https://github.com/Expensify/App/pull/43036

VickyStash commented 2 months ago

This one could also be related: https://github.com/Expensify/App/pull/43036

@carlosmiceli This PR was reverted several days ago: https://github.com/Expensify/App/pull/44891

lakchote commented 2 months ago

@lanitochka17 is the expected result correct?

Shouldn't it read:

The invoice report will be appear broken
+ The invoice report will not appear broken
Julesssss commented 2 months ago

After a lot of discussion, I am removing the blocker label here. Some reasons:

wasxxm commented 2 months ago

Proposal

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

After sending an invoice on staging.new.expensify.com, the invoice report appears broken when viewed in the invoice chat's preview.

What is the root cause of that problem?

The API post request to https://dev.new.expensify.com:8083/api/OpenReport? returns two report action items for a single invoice request. This then gets into the /src/libs/ReportActionsUtils.ts function getCombinedReportActions where the condition gets invoked,

if (_.isEmpty(transactionThreadReportID) || isSentMoneyReport) { return reportActions; }

and returns a json such as in my case:

[ { "actionName": "IOU", "actorAccountID": 17802616, "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/285f0f984f8c54c9ca2c386d0e16587f5d98e416_128.jpeg", "created": "2024-07-09 11:06:37.039", "lastModified": "2024-07-09 11:06:37.039", "message": [ { "type": "COMMENT", "html": "PKR 666.00 expense", "text": "PKR 666.00 expense", "isEdited": false, "whisperedTo": [], "isDeletedParentAction": false, "deleted": "", "reactions": [] } ], "originalMessage": { "IOUReportID": 4036965968393671, "IOUTransactionID": "8926360487896345398", "amount": 66600, "comment": "", "currency": "PKR", "lastModified": "2024-07-09 11:06:37.039", "participantAccountIDs": [ 17802616, 17812374 ], "type": "create" }, "person": [ { "type": "TEXT", "style": "strong", "text": "Waseem Khan" } ], "previousReportActionID": "9118663482144987684", "reportActionID": "2454612885366525747", "shouldShow": true, "reportID": 4036965968393671, "timestamp": 1720523197, "reportActionTimestamp": 1720523197039, "automatic": false, "childReportID": "1152139126218266", "childType": "chat", "childReportNotificationPreference": "hidden", "whisperedToAccountIDs": [], "actorEmail": "wasxxm@gmail.com" }, { "reportActionID": "9118663482144987684", "previousReportActionID": "0", "actionName": "CREATED", "created": "2024-07-09 11:06:37.036", "reportActionTimestamp": 1720523197036, "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/285f0f984f8c54c9ca2c386d0e16587f5d98e416_128.jpeg", "message": [ { "type": "TEXT", "style": "strong", "text": "You" }, { "type": "TEXT", "style": "normal", "text": " created this invoice" } ], "person": [ { "type": "TEXT", "style": "strong", "text": "Waseem Khan" } ], "automatic": false, "sequenceNumber": 0, "shouldShow": true, "lastModified": "2024-07-09 11:06:37.036" }, { "actionName": "IOU", "actorAccountID": 17802616, "automatic": false, "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/285f0f984f8c54c9ca2c386d0e16587f5d98e416_128.jpeg", "isAttachment": false, "originalMessage": { "amount": 66600, "comment": "", "currency": "PKR", "IOUTransactionID": "8926360487896345398", "IOUReportID": "4036965968393671", "type": "create", "whisperedTo": [] }, "message": [ { "html": "submitted PKR 666.00", "text": "submitted PKR 666.00", "isEdited": false, "type": "COMMENT" } ], "person": [ { "style": "strong", "text": "Waseem Khan", "type": "TEXT" } ], "reportActionID": "1883657703434015412", "shouldShow": true, "created": "2024-07-09 11:06:36.718", "childReportID": "1152139126218266" }, { "reportActionID": "2267213713692662799", "actionName": "CREATED", "actorAccountID": 17802616, "message": [ { "type": "TEXT", "style": "strong", "text": "thevideos.club@gmail.com" }, { "type": "TEXT", "style": "normal", "text": " created this report" } ], "person": [ { "type": "TEXT", "style": "strong", "text": "Waseem Khan" } ], "automatic": false, "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/285f0f984f8c54c9ca2c386d0e16587f5d98e416_128.jpeg", "created": "2024-07-09 11:06:36.717", "shouldShow": true } ]

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

We can either remove the duplicate entries at index 2 and 3 in the above Json at the backend or apply some filter like checking for duplicate IOUTransactionIDs (this will, however, break other thread types)

Please see the screen-recording for a better understanding of what I mean: https://drive.google.com/file/d/1YHXqASNkDGyHHcbMd6BtTTAy0DWcz2hr/view?usp=sharing

melvin-bot[bot] commented 2 months ago

📣 @wasxxm! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details. Screen Shot 2022-11-16 at 4 42 54 PM Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
wasxxm commented 2 months ago

Contributor details

Your Expensify account email: wasxxm@gmail.com Upwork Profile Link: https://www.upwork.com/freelancers/~01ab286685847db20e?viewMode=1

melvin-bot[bot] commented 2 months ago

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

lanitochka17 commented 2 months ago

@lakchote Sorry for the confusion Expected result updated

melvin-bot[bot] commented 2 months ago

@carlosmiceli, @akinwale, @Julesssss Whoops! This issue is 2 days overdue. Let's get this updated quick!

wasxxm commented 2 months ago

Please see my fix at https://github.com/Expensify/App/issues/44388#issuecomment-2219303604 for the other related issue which also fixes this one.

carlosmiceli commented 2 months ago

It's being worked on.

carlosmiceli commented 2 months ago

Continues to be worked on here: https://github.com/Expensify/App/issues/44388

carlosmiceli commented 2 months ago

You're weird Melvin.

cristipaval commented 2 months ago

@carlosmiceli , this issue might have the same root cause as this one

We can put a hold on and test it when the other is closed.

carlosmiceli commented 2 months ago

Yeah, there's a few issues in parallel about this, sounds good!

melvin-bot[bot] commented 1 month ago

This issue has not been updated in over 15 days. @carlosmiceli, @akinwale eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

rayane-djouah commented 3 weeks ago

PR is merged