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.29k stars 2.72k forks source link

[Pending / Scanning] Expensify Card Expenses - Duplicate expenses are displayed in report after expense is posted #45491

Closed isagoico closed 1 week ago

isagoico 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.7-4

Reproducible in staging?: Yes Reproducible in production?: Yes

Email or phone of affected tester (no customers): tester+ndcardtests@applausecard.expensifail.com

Logs: https://stackoverflow.com/c/expensify/questions/4856

Issue reported by: Applause - Internal Team

Action Performed:

Affected account: tester+ndcardtests@applausecard.expensifail.com Report ID of the bug: 2317033129992857

  1. Make 2 purchases with a Expensify Card
  2. Wait ~1-2 days for the pending expenses to be posted
  3. Check the report

Expected Result:

There should be 1 expense for each transaction made with the expensify card.

Actual Result:

There's 5 expenses in the report when there should have been 2.

Platforms:

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

Screenshots/Videos

image

image

In the video below I opened each of the transactions and looks like some of them are missing the receipts.

https://github.com/user-attachments/assets/3e9635b3-b1b3-47f6-9a87-df66f627aa0d

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01a5413fbd68d264d8
  • Upwork Job ID: 1817914452736699408
  • Last Price Increase: 2024-08-05
Issue OwnerCurrent Issue Owner: @grgia
melvin-bot[bot] commented 1 month ago

Current assignee @kevinksullivan is eligible for the Bug assigner, not assigning anyone new.

melvin-bot[bot] commented 1 month ago

@kevinksullivan Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] commented 1 month ago

@kevinksullivan Still overdue 6 days?! Let's take care of this!

melvin-bot[bot] commented 1 month ago

@kevinksullivan 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

kevinksullivan commented 1 month ago

Posted about this here

grgia commented 1 month ago

This seems like a FE bug but we do use two different API calls for grabbing transaction list in old vs new, so it could be related to that if not

grgia commented 1 month ago
image

Supportalled in NewDot and I only see 2 transactions in ONYX and in the result from OpenReport for 2317033129992857

{
    "onyxData": [
        {
            "key": "policy_73560FF3FBF3A26E",
            "onyxMethod": "merge",
            "value": {
                "achAccount": null,
                "address": [],
                "approvalMode": "OPTIONAL",
                "approver": "tester@applausecard.expensifail.com",
                "areCategoriesEnabled": true,
                "areConnectionsEnabled": false,
                "areDistanceRatesEnabled": true,
                "areExpensifyCardsEnabled": false,
                "areReportFieldsEnabled": false,
                "areTagsEnabled": false,
                "areWorkflowsEnabled": false,
                "autoReimbursementLimit": 0,
                "autoReporting": false,
                "autoReportingFrequency": "immediate",
                "autoReportingOffset": 1,
                "avatar": "",
                "avatarURL": "",
                "customUnits": {
                    "9CE353F9E7F24": {
                        "attributes": {
                            "unit": "mi"
                        },
                        "customUnitID": "9CE353F9E7F24",
                        "defaultCategory": "Car",
                        "enabled": true,
                        "name": "Distance",
                        "rates": {
                            "D7BA30B19A0E1": {
                                "attributes": [],
                                "currency": "USD",
                                "customUnitRateID": "D7BA30B19A0E1",
                                "enabled": true,
                                "name": "Default Rate",
                                "rate": 67,
                                "subRates": []
                            }
                        }
                    }
                },
                "defaultBillable": false,
                "description": "",
                "disabledFields": {
                    "defaultBillable": true,
                    "reimbursable": false
                },
                "employeeList": {
                    "tester+igadmin@applausecard.expensifail.com": {
                        "email": "tester+igadmin@applausecard.expensifail.com",
                        "role": "admin",
                        "submitsTo": "tester+igadmin@applausecard.expensifail.com"
                    },
                    "tester+ndcardtests@applausecard.expensifail.com": {
                        "email": "tester+ndcardtests@applausecard.expensifail.com",
                        "role": "user",
                        "submitsTo": "tester+igadmin@applausecard.expensifail.com"
                    },
                    "tester@applausecard.expensifail.com": {
                        "email": "tester@applausecard.expensifail.com",
                        "role": "admin",
                        "submitsTo": "tester+igadmin@applausecard.expensifail.com"
                    }
                },
                "fieldList": {
                    "text_title": {
                        "defaultExternalID": null,
                        "defaultValue": "{report:type} {report:startdate}",
                        "deletable": true,
                        "disabledOptions": [],
                        "externalID": null,
                        "externalIDs": [],
                        "fieldID": "text_title",
                        "isTax": false,
                        "keys": [],
                        "name": "title",
                        "orderWeight": 0,
                        "origin": null,
                        "target": "expense",
                        "type": "formula",
                        "value": null,
                        "values": []
                    }
                },
                "harvesting": {
                    "enabled": false
                },
                "hasMultipleTagLists": false,
                "isPolicyExpenseChatEnabled": true,
                "name": "Card Tests - DO NOT DELETE",
                "preventSelfApproval": false,
                "reimbursementChoice": "reimburseNo",
                "requiresCategory": false,
                "requiresTag": false,
                "role": "user",
                "tax": {
                    "trackingEnabled": false
                },
                "type": "team"
            }
        },
        {
            "key": "policyCategories_73560FF3FBF3A26E",
            "onyxMethod": "set",
            "value": {
                "Advertising": {
                    "enabled": true,
                    "name": "Advertising"
                },
                "Benefits": {
                    "enabled": true,
                    "name": "Benefits"
                },
                "Car": {
                    "enabled": true,
                    "name": "Car"
                },
                "Equipment": {
                    "enabled": true,
                    "name": "Equipment"
                },
                "Fees": {
                    "enabled": true,
                    "name": "Fees"
                },
                "Home Office": {
                    "enabled": true,
                    "name": "Home Office"
                },
                "Insurance": {
                    "enabled": true,
                    "name": "Insurance"
                },
                "Interest": {
                    "enabled": true,
                    "name": "Interest"
                },
                "Labor": {
                    "enabled": true,
                    "name": "Labor"
                },
                "Maintenance": {
                    "enabled": true,
                    "name": "Maintenance"
                },
                "Materials": {
                    "enabled": true,
                    "name": "Materials"
                },
                "Meals and Entertainment": {
                    "enabled": true,
                    "name": "Meals and Entertainment"
                },
                "Office Supplies": {
                    "enabled": true,
                    "name": "Office Supplies"
                },
                "Other": {
                    "enabled": true,
                    "name": "Other"
                },
                "Professional Services": {
                    "enabled": true,
                    "name": "Professional Services"
                },
                "Rent": {
                    "enabled": true,
                    "name": "Rent"
                },
                "Taxes": {
                    "enabled": true,
                    "name": "Taxes"
                },
                "Travel": {
                    "enabled": true,
                    "name": "Travel"
                },
                "Utilities": {
                    "enabled": true,
                    "name": "Utilities"
                }
            }
        },
        {
            "key": "policyTags_73560FF3FBF3A26E",
            "onyxMethod": "set",
            "value": {
                "Tag": {
                    "name": "Tag",
                    "orderWeight": 0,
                    "required": false,
                    "tags": []
                }
            }
        },
        {
            "onyxMethod": "merge",
            "key": "report_2317033129992857",
            "value": {
                "avatarUrl": null,
                "chatReportID": "3457964970792874",
                "chatType": "",
                "currency": "USD",
                "description": "",
                "errorFields": {
                    "export": null,
                    "notFound": null
                },
                "fieldList": null,
                "hasOutstandingChildRequest": false,
                "hasOutstandingChildTask": false,
                "hasParentAccess": true,
                "invoiceReceiver": null,
                "iouReportID": null,
                "isCancelledIOU": false,
                "isDeletedParentAction": null,
                "isOwnPolicyExpenseChat": false,
                "isPinned": false,
                "isWaitingOnBankAccount": false,
                "lastActionType": "IOU",
                "lastActorAccountID": "17839728",
                "lastMentionedTime": null,
                "lastMessageHtml": "$1.00 expense",
                "lastMessageText": "$1.00 expense",
                "lastReadSequenceNumber": 0,
                "lastReadTime": "2024-07-16 15:22:14.534",
                "lastVisibleActionCreated": "2024-07-13 21:14:24.122",
                "lastVisibleActionLastModified": "2024-07-13 21:14:24.122",
                "managerID": 0,
                "nonReimbursableTotal": -200,
                "notificationPreference": "hidden",
                "oldPolicyName": "",
                "ownerAccountID": 17839728,
                "parentReportActionID": "6778857245063212367",
                "parentReportID": "3457964970792874",
                "participants": {
                    "17839728": {
                        "hidden": true
                    },
                    "8198785": {
                        "hidden": true
                    },
                    "8911382": {
                        "hidden": true
                    }
                },
                "permissions": [],
                "policyAvatar": null,
                "policyID": "73560FF3FBF3A26E",
                "policyName": null,
                "private_isArchived": "",
                "reportID": "2317033129992857",
                "reportName": "Expense Report 2024-07-12",
                "stateNum": 0,
                "statusNum": 0,
                "total": -200,
                "tripData": null,
                "type": "expense",
                "unheldTotal": 0,
                "visibility": null,
                "welcomeMessage": "",
                "writeCapability": "all"
            }
        },
        {
            "onyxMethod": "mergecollection",
            "key": "transactionViolations_",
            "value": {
                "transactionViolations_3226191738451646360": null,
                "transactionViolations_6479855573674922204": null
            }
        },
        {
            "onyxMethod": "mergecollection",
            "key": "transactions_",
            "value": {
                "transactions_3226191738451646360": {
                    "amount": -100,
                    "billable": false,
                    "cardID": 20582964,
                    "category": "Professional Services",
                    "comment": {
                        "comment": "",
                        "forceReimbursable": false,
                        "liabilityType": "corporate"
                    },
                    "created": "2024-07-12 21:53:02",
                    "currency": "USD",
                    "filename": "",
                    "merchant": "PAYPAL *EXPENSIFYIN",
                    "modifiedAmount": 0,
                    "modifiedCreated": "2024-07-12 21:53:02",
                    "modifiedCurrency": "",
                    "modifiedMerchant": "Expensify",
                    "originalAmount": 0,
                    "originalCurrency": "",
                    "parentTransactionID": "6487115046812146592",
                    "receipt": {},
                    "reimbursable": false,
                    "reportID": "2317033129992857",
                    "status": "Posted",
                    "tag": "",
                    "transactionID": "3226191738451646360",
                    "mccGroup": "Services",
                    "hasEReceipt": true
                },
                "transactions_6479855573674922204": {
                    "amount": -100,
                    "billable": false,
                    "cardID": 20582964,
                    "category": "Professional Services",
                    "comment": {
                        "comment": "",
                        "forceReimbursable": false,
                        "liabilityType": "corporate"
                    },
                    "created": "2024-07-12 21:49:52",
                    "currency": "USD",
                    "filename": "",
                    "merchant": "PAYPAL *EXPENSIFYIN",
                    "modifiedAmount": 0,
                    "modifiedCreated": "2024-07-12 21:49:52",
                    "modifiedCurrency": "",
                    "modifiedMerchant": "Expensify",
                    "originalAmount": 0,
                    "originalCurrency": "",
                    "parentTransactionID": "943836261592768951",
                    "receipt": {},
                    "reimbursable": false,
                    "reportID": "2317033129992857",
                    "status": "Posted",
                    "tag": "",
                    "transactionID": "6479855573674922204",
                    "mccGroup": "Services",
                    "hasEReceipt": true
                }
            }
        },
        {
            "onyxMethod": "merge",
            "key": "reportActions_2317033129992857",
            "value": {
                "6628179434884406614": {
                    "person": [
                        {
                            "type": "TEXT",
                            "style": "strong",
                            "text": "tester+ndcardtests@applausecard.expensifail.com"
                        }
                    ],
                    "actorAccountID": 17839728,
                    "message": [
                        {
                            "type": "COMMENT",
                            "html": "$1.00 expense",
                            "text": "$1.00 expense",
                            "isEdited": false,
                            "whisperedTo": [],
                            "isDeletedParentAction": false,
                            "deleted": "",
                            "reactions": []
                        }
                    ],
                    "originalMessage": {
                        "IOUReportID": 2317033129992857,
                        "IOUTransactionID": "415430727551207295",
                        "amount": -100,
                        "comment": "",
                        "currency": "USD",
                        "lastModified": "2024-07-13 21:14:24.122",
                        "participantAccountIDs": [
                            17839728
                        ],
                        "type": "create"
                    },
                    "avatar": "https:\/\/d2k5nsl2zxldvw.cloudfront.net\/images\/avatars\/default-avatar_1.png",
                    "created": "2024-07-13 21:14:24.122",
                    "timestamp": 1720905264,
                    "reportActionTimestamp": 1720905264122,
                    "automatic": false,
                    "actionName": "IOU",
                    "shouldShow": true,
                    "reportActionID": "6628179434884406614",
                    "previousReportActionID": "1861591755636839343",
                    "lastModified": "2024-07-13 21:14:24.122",
                    "childReportID": "5207035799337010",
                    "childType": "chat",
                    "childReportNotificationPreference": "hidden",
                    "whisperedToAccountIDs": []
                },
                "1861591755636839343": {
                    "person": [
                        {
                            "type": "TEXT",
                            "style": "strong",
                            "text": "tester+ndcardtests@applausecard.expensifail.com"
                        }
                    ],
                    "actorAccountID": 17839728,
                    "message": [
                        {
                            "type": "COMMENT",
                            "html": "$1.00 expense",
                            "text": "$1.00 expense",
                            "isEdited": false,
                            "whisperedTo": [],
                            "isDeletedParentAction": false,
                            "deleted": "",
                            "reactions": []
                        }
                    ],
                    "originalMessage": {
                        "IOUReportID": 2317033129992857,
                        "IOUTransactionID": "6988537235282388603",
                        "amount": -100,
                        "comment": "",
                        "currency": "USD",
                        "lastModified": "2024-07-13 21:14:22.815",
                        "participantAccountIDs": [
                            17839728
                        ],
                        "type": "create"
                    },
                    "avatar": "https:\/\/d2k5nsl2zxldvw.cloudfront.net\/images\/avatars\/default-avatar_1.png",
                    "created": "2024-07-13 21:14:22.815",
                    "timestamp": 1720905262,
                    "reportActionTimestamp": 1720905262815,
                    "automatic": false,
                    "actionName": "IOU",
                    "shouldShow": true,
                    "reportActionID": "1861591755636839343",
                    "previousReportActionID": "6964836598151344626",
                    "lastModified": "2024-07-13 21:14:22.815",
                    "childReportID": "2455264449052416",
                    "childType": "chat",
                    "childReportNotificationPreference": "hidden",
                    "whisperedToAccountIDs": []
                },
                "6964836598151344626": {
                    "person": [
                        {
                            "type": "TEXT",
                            "style": "strong",
                            "text": "tester+ndcardtests@applausecard.expensifail.com"
                        }
                    ],
                    "actorAccountID": 17839728,
                    "message": [
                        {
                            "type": "COMMENT",
                            "html": "$1.00 expense",
                            "text": "$1.00 expense",
                            "isEdited": false,
                            "whisperedTo": [],
                            "isDeletedParentAction": false,
                            "deleted": "",
                            "reactions": []
                        }
                    ],
                    "originalMessage": {
                        "IOUReportID": 2317033129992857,
                        "IOUTransactionID": "2253547519482058881",
                        "amount": -100,
                        "comment": "",
                        "currency": "USD",
                        "lastModified": "2024-07-13 21:14:22.078",
                        "participantAccountIDs": [
                            17839728
                        ],
                        "type": "create"
                    },
                    "avatar": "https:\/\/d2k5nsl2zxldvw.cloudfront.net\/images\/avatars\/default-avatar_1.png",
                    "created": "2024-07-13 21:14:22.078",
                    "timestamp": 1720905262,
                    "reportActionTimestamp": 1720905262078,
                    "automatic": false,
                    "actionName": "IOU",
                    "shouldShow": true,
                    "reportActionID": "6964836598151344626",
                    "previousReportActionID": "4087102546398105114",
                    "lastModified": "2024-07-13 21:14:22.078",
                    "childReportID": "529954639996300",
                    "childType": "chat",
                    "childReportNotificationPreference": "hidden",
                    "whisperedToAccountIDs": []
                },
                "4087102546398105114": {
                    "person": [
                        {
                            "type": "TEXT",
                            "style": "strong",
                            "text": "tester+ndcardtests@applausecard.expensifail.com"
                        }
                    ],
                    "actorAccountID": 17839728,
                    "message": [
                        {
                            "type": "COMMENT",
                            "html": "$1.00 expense",
                            "text": "$1.00 expense",
                            "isEdited": false,
                            "whisperedTo": [],
                            "isDeletedParentAction": false,
                            "deleted": "",
                            "reactions": []
                        }
                    ],
                    "originalMessage": {
                        "IOUReportID": 2317033129992857,
                        "IOUTransactionID": "3226191738451646360",
                        "amount": -100,
                        "comment": "",
                        "currency": "USD",
                        "lastModified": "2024-07-12 21:53:04.172",
                        "participantAccountIDs": [
                            17839728
                        ],
                        "type": "create"
                    },
                    "avatar": "https:\/\/d2k5nsl2zxldvw.cloudfront.net\/images\/avatars\/default-avatar_1.png",
                    "created": "2024-07-12 21:53:04.172",
                    "timestamp": 1720821184,
                    "reportActionTimestamp": 1720821184172,
                    "automatic": false,
                    "actionName": "IOU",
                    "shouldShow": true,
                    "reportActionID": "4087102546398105114",
                    "previousReportActionID": "2050702013743578683",
                    "lastModified": "2024-07-12 21:53:04.172",
                    "childReportID": "6294214765156210",
                    "childType": "chat",
                    "childReportNotificationPreference": "hidden",
                    "whisperedToAccountIDs": []
                },
                "2050702013743578683": {
                    "person": [
                        {
                            "type": "TEXT",
                            "style": "strong",
                            "text": "tester+ndcardtests@applausecard.expensifail.com"
                        }
                    ],
                    "actorAccountID": 17839728,
                    "message": [
                        {
                            "type": "COMMENT",
                            "html": "$1.00 expense",
                            "text": "$1.00 expense",
                            "isEdited": false,
                            "whisperedTo": [],
                            "isDeletedParentAction": false,
                            "deleted": "",
                            "reactions": []
                        }
                    ],
                    "originalMessage": {
                        "IOUReportID": 2317033129992857,
                        "IOUTransactionID": "6479855573674922204",
                        "amount": -100,
                        "comment": "",
                        "currency": "USD",
                        "lastModified": "2024-07-12 21:49:53.654",
                        "participantAccountIDs": [
                            17839728
                        ],
                        "type": "create"
                    },
                    "avatar": "https:\/\/d2k5nsl2zxldvw.cloudfront.net\/images\/avatars\/default-avatar_1.png",
                    "created": "2024-07-12 21:49:53.654",
                    "timestamp": 1720820993,
                    "reportActionTimestamp": 1720820993654,
                    "automatic": false,
                    "actionName": "IOU",
                    "shouldShow": true,
                    "reportActionID": "2050702013743578683",
                    "previousReportActionID": "3921465899743695931",
                    "lastModified": "2024-07-12 21:49:53.654",
                    "childReportID": "8422474908997718",
                    "childType": "chat",
                    "childReportNotificationPreference": "hidden",
                    "whisperedToAccountIDs": []
                },
                "3921465899743695931": {
                    "person": [
                        {
                            "type": "TEXT",
                            "style": "strong",
                            "text": "tester+ndcardtests@applausecard.expensifail.com"
                        }
                    ],
                    "actorAccountID": 17839728,
                    "message": [],
                    "originalMessage": {
                        "action": "create",
                        "lastModified": "2024-07-12 21:49:53.653",
                        "transactionID": 943836261592768951
                    },
                    "avatar": "https:\/\/d2k5nsl2zxldvw.cloudfront.net\/images\/avatars\/default-avatar_1.png",
                    "created": "2024-07-12 21:49:53.653",
                    "timestamp": 1720820993,
                    "reportActionTimestamp": 1720820993653,
                    "automatic": false,
                    "actionName": "BILLABLEUPDATETRANSACTION",
                    "shouldShow": false,
                    "reportActionID": "3921465899743695931",
                    "previousReportActionID": "5088178108555773017",
                    "lastModified": "2024-07-12 21:49:53.653",
                    "whisperedToAccountIDs": []
                },
                "5088178108555773017": {
                    "reportActionID": "5088178108555773017",
                    "previousReportActionID": "0",
                    "actionName": "CREATED",
                    "created": "2024-07-12 21:49:53.393",
                    "reportActionTimestamp": 1720820993393,
                    "avatar": "",
                    "message": [
                        {
                            "type": "TEXT",
                            "style": "strong",
                            "text": "Concierge"
                        },
                        {
                            "type": "TEXT",
                            "style": "normal",
                            "text": " created this report"
                        }
                    ],
                    "person": [
                        {
                            "type": "TEXT",
                            "style": "strong",
                            "text": "Concierge"
                        }
                    ],
                    "automatic": true,
                    "sequenceNumber": 0,
                    "shouldShow": true,
                    "lastModified": "2024-07-12 21:49:53.393"
                }
            }
        },
        {
            "onyxMethod": "merge",
            "key": "personalDetailsList",
            "value": {
                "17839728": {
                    "accountID": 17839728,
                    "avatar": "https:\/\/d2k5nsl2zxldvw.cloudfront.net\/images\/avatars\/default-avatar_1.png",
                    "firstName": "",
                    "lastName": "",
                    "status": null,
                    "displayName": "tester+ndcardtests@applausecard.expensifail.com",
                    "login": "tester+ndcardtests@applausecard.expensifail.com",
                    "pronouns": "",
                    "timezone": {
                        "automatic": true,
                        "selected": "America\/Caracas"
                    },
                    "phoneNumber": "",
                    "validated": true
                },
                "8198785": {
                    "accountID": 8198785,
                    "avatar": "https:\/\/d1wpcgnaa73g0y.cloudfront.net\/652e63d2f462ca9a1283063cec6ef3f5a03ffbae_128.jpeg",
                    "firstName": "Card test",
                    "lastName": "Applause Account",
                    "status": null,
                    "displayName": "Card test Applause Account",
                    "login": "tester@applausecard.expensifail.com",
                    "pronouns": "",
                    "timezone": {
                        "automatic": true,
                        "selected": "Africa\/Addis_Ababa"
                    },
                    "phoneNumber": "",
                    "validated": true
                },
                "8911382": {
                    "accountID": 8911382,
                    "avatar": "https:\/\/d2k5nsl2zxldvw.cloudfront.net\/images\/avatars\/default-avatar_15.png",
                    "firstName": "Isabella",
                    "lastName": "Goicoechea",
                    "status": null,
                    "displayName": "Isabella Goicoechea",
                    "login": "tester+igadmin@applausecard.expensifail.com",
                    "pronouns": "",
                    "timezone": {
                        "automatic": "true",
                        "selected": "America\/Caracas"
                    },
                    "phoneNumber": "",
                    "validated": true
                }
            }
        },
        {
            "onyxMethod": "merge",
            "key": "reportActions_3457964970792874",
            "value": {
                "6778857245063212367": {
                    "person": [
                        {
                            "type": "TEXT",
                            "style": "strong",
                            "text": "__fake__"
                        }
                    ],
                    "actorAccountID": 0,
                    "message": [
                        {
                            "type": "COMMENT",
                            "html": "Card Tests - DO NOT DELETE owes $2.00",
                            "text": "Card Tests - DO NOT DELETE owes $2.00",
                            "isEdited": false,
                            "whisperedTo": [],
                            "isDeletedParentAction": false,
                            "deleted": "",
                            "reactions": []
                        }
                    ],
                    "originalMessage": {
                        "lastModified": "2024-07-12 21:49:53.395",
                        "linkedReportID": "2317033129992857"
                    },
                    "avatar": "https:\/\/d2k5nsl2zxldvw.cloudfront.net\/images\/avatars\/default-avatar_1.png",
                    "created": "2024-07-12 21:49:53.395",
                    "timestamp": 1720820993,
                    "reportActionTimestamp": 1720820993395,
                    "automatic": false,
                    "actionName": "REPORTPREVIEW",
                    "shouldShow": true,
                    "reportActionID": "6778857245063212367",
                    "previousReportActionID": "585545579494397462",
                    "lastModified": "2024-07-12 21:49:53.395",
                    "childReportID": "2317033129992857",
                    "childType": "expense",
                    "childReportNotificationPreference": "hidden",
                    "childLastActorAccountID": 17839728,
                    "childMoneyRequestCount": 5,
                    "childReportName": "Expense Report 2024-07-12",
                    "childOwnerAccountID": 17839728,
                    "whisperedToAccountIDs": []
                }
            }
        },
        {
            "onyxMethod": "set",
            "key": "reportNextStep_2317033129992857",
            "value": {
                "message": [
                    {
                        "text": "Waiting for "
                    },
                    {
                        "text": "tester+ndcardtests@applausecard.expensifail.com",
                        "type": "strong",
                        "tooltipText": "tester+ndcardtests@applausecard.expensifail.com (click to copy)",
                        "clickToCopyText": "tester+ndcardtests@applausecard.expensifail.com"
                    },
                    {
                        "text": " to "
                    },
                    {
                        "text": "add",
                        "type": "strong"
                    },
                    {
                        "text": " %expenses."
                    }
                ],
                "title": "Next Step:",
                "requiresUserAction": true,
                "type": null,
                "showUndoSubmit": false,
                "showForMobile": true,
                "showForExpense": true,
                "nextReceiver": "tester@applausecard.expensifail.com",
                "icon": "hourglass"
            }
        },
        {
            "onyxMethod": "mergecollection",
            "key": "report_",
            "value": {
                "report_3457964970792874": {
                    "avatarUrl": null,
                    "chatReportID": null,
                    "chatType": "policyExpenseChat",
                    "currency": "USD",
                    "description": "",
                    "errorFields": {
                        "export": null,
                        "notFound": null
                    },
                    "fieldList": null,
                    "hasOutstandingChildRequest": true,
                    "hasOutstandingChildTask": false,
                    "hasParentAccess": null,
                    "invoiceReceiver": null,
                    "iouReportID": "2317033129992857",
                    "isCancelledIOU": false,
                    "isDeletedParentAction": null,
                    "isOwnPolicyExpenseChat": true,
                    "isPinned": true,
                    "isWaitingOnBankAccount": false,
                    "lastActionType": "REPORTPREVIEW",
                    "lastActorAccountID": "",
                    "lastMentionedTime": null,
                    "lastMessageHtml": "Card Tests - DO NOT DELETE owes $2.00",
                    "lastMessageText": "Card Tests - DO NOT DELETE owes $2.00",
                    "lastReadSequenceNumber": 0,
                    "lastReadTime": "2024-07-12 21:50:06.017",
                    "lastVisibleActionCreated": "2024-07-12 21:49:53.395",
                    "lastVisibleActionLastModified": "2024-07-12 21:49:53.395",
                    "managerID": 0,
                    "nonReimbursableTotal": 0,
                    "notificationPreference": "always",
                    "oldPolicyName": "",
                    "ownerAccountID": 17839728,
                    "parentReportActionID": null,
                    "parentReportID": null,
                    "participants": {
                        "17839728": {
                            "hidden": false
                        },
                        "8198785": {
                            "hidden": false
                        },
                        "8911382": {
                            "hidden": false
                        }
                    },
                    "permissions": [],
                    "policyAvatar": "",
                    "policyID": "73560FF3FBF3A26E",
                    "policyName": "Card Tests - DO NOT DELETE",
                    "private_isArchived": "",
                    "reportID": "3457964970792874",
                    "reportName": "Chat Report",
                    "stateNum": 0,
                    "statusNum": 0,
                    "total": 0,
                    "tripData": null,
                    "type": "chat",
                    "unheldTotal": 0,
                    "visibility": null,
                    "welcomeMessage": "",
                    "writeCapability": "all"
                }
            }
        },
        {
            "onyxMethod": "mergecollection",
            "key": "reportActions_",
            "value": {
                "reportActions_3457964970792874": {
                    "6778857245063212367": {
                        "person": [
                            {
                                "type": "TEXT",
                                "style": "strong",
                                "text": "__fake__"
                            }
                        ],
                        "actorAccountID": 0,
                        "message": [
                            {
                                "type": "COMMENT",
                                "html": "Card Tests - DO NOT DELETE owes $2.00",
                                "text": "Card Tests - DO NOT DELETE owes $2.00",
                                "isEdited": false,
                                "whisperedTo": [],
                                "isDeletedParentAction": false,
                                "deleted": "",
                                "reactions": []
                            }
                        ],
                        "originalMessage": {
                            "lastModified": "2024-07-12 21:49:53.395",
                            "linkedReportID": "2317033129992857"
                        },
                        "avatar": "https:\/\/d2k5nsl2zxldvw.cloudfront.net\/images\/avatars\/default-avatar_1.png",
                        "created": "2024-07-12 21:49:53.395",
                        "timestamp": 1720820993,
                        "reportActionTimestamp": 1720820993395,
                        "automatic": false,
                        "actionName": "REPORTPREVIEW",
                        "shouldShow": true,
                        "reportActionID": "6778857245063212367",
                        "previousReportActionID": "585545579494397462",
                        "lastModified": "2024-07-12 21:49:53.395",
                        "actorEmail": "__fake__",
                        "childReportID": "2317033129992857",
                        "childType": "expense",
                        "childReportNotificationPreference": "hidden",
                        "childLastActorAccountID": 17839728,
                        "childMoneyRequestCount": 5,
                        "childReportName": "Expense Report 2024-07-12",
                        "childOwnerAccountID": 17839728,
                        "whisperedToAccountIDs": []
                    }
                }
            }
        }
    ],
    "jsonCode": 200,
    "requestID": "8aad6b84283352a6-LHR"
}
melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

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

grgia commented 1 month ago

@youssef-lr maybe there's some leftover whisper logic in App in terms of creating optimistic reports?

grgia commented 1 month ago

@ZhenjaHorbach fairly certain this one is External and an optimistic expense issue that's leftover from removing the whisper flow from pending transactions

melvin-bot[bot] commented 1 month ago

@kevinksullivan @grgia @ZhenjaHorbach 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!

youssef-lr commented 1 month ago

fairly certain this one is External and an optimistic expense issue that's leftover from removing the whisper flow from pending transactions

@grgia I'm not sure there is anything optimistic here as these transactions are created in the backend, no?

melvin-bot[bot] commented 1 month ago

@kevinksullivan, @grgia, @ZhenjaHorbach Whoops! This issue is 2 days overdue. Let's get this updated quick!

kevinksullivan commented 1 month ago

let's discuss this here

https://expensify.slack.com/archives/C01GTK53T8Q/p1722551332224849

grgia commented 1 month ago

I think we need to confirm this is still occurring, I wasn't able to replicate locally

grgia commented 1 month ago

I've been looking into this today, it seems like there is an issue with updating the report preview / transaction data for merged transactions. I haven't found the root cause yet

melvin-bot[bot] commented 1 month 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 month ago

@kevinksullivan, @grgia, @ZhenjaHorbach Still overdue 6 days?! Let's take care of this!

grgia commented 4 weeks ago

It seems like we're not updating onyx properly. We need to remove the pending transaction from onyx when a transaction posts.

For example: I have a child transaction (transactions_2481341321094301911) with parent (7330177383521645395)

For some reason, (transactions_7330177383521645395) with reportID -4 is on report 7638474919497989

And the report preview looks like this:

image

Then there's a report preview that looks correct, but points to the parent (the one where hasEReceipt is false... which is weird- because it shows an eReceipt preview...)

image
    {
        "key": "transactions_2481341321094301911",
        "value": {
            "amount": -200,
            "bank": "Expensify Card",
            "billable": false,
            "cardID": 19501470,
            "cardName": "Expensify Card - 1825",
            "cardNumber": "455594XXXXXX1825",
            "category": "Professional Services",
            "comment": {
                "comment": "",
                "forceReimbursable": false,
                "liabilityType": "corporate"
            },
            "created": "2024-08-05 12:11:32",
            "currency": "USD",
            "filename": "",
            "managedCard": true,
            "merchant": "PAYPAL *EXPENSIFYIN",
            "modifiedAmount": 0,
            "modifiedCreated": "2024-08-05 12:11:32",
            "modifiedCurrency": "",
            "modifiedMerchant": "Expensify",
            "originalAmount": 0,
            "originalCurrency": "",
            "parentTransactionID": "7330177383521645395",
            "receipt": {},
            "reimbursable": false,
            "reportID": "1173998813191873",
            "status": "Posted",
            "tag": "",
            "transactionID": "2481341321094301911",
            "mccGroup": "Services",
            "hasEReceipt": true
        }
    },
    {
        "key": "transactions_7330177383521645395",
        "value": {
            "amount": -200,
            "bank": "Expensify Card",
            "billable": false,
            "cardID": 19501470,
            "cardName": "Expensify Card - 1825",
            "cardNumber": "455594XXXXXX1825",
            "category": "Professional Services",
            "comment": {
                "comment": "",
                "forceReimbursable": false,
                "liabilityType": "corporate"
            },
            "created": "2024-08-05 12:11:32",
            "currency": "USD",
            "filename": "",
            "managedCard": true,
            "merchant": "PAYPAL *EXPENSIFYIN",
            "modifiedAmount": 0,
            "modifiedCreated": "",
            "modifiedCurrency": "",
            "modifiedMerchant": "Expensify",
            "originalAmount": 0,
            "originalCurrency": "",
            "parentTransactionID": "",
            "receipt": {},
            "reimbursable": false,
            "reportID": "-4",
            "status": "Pending",
            "tag": "",
            "transactionID": "7330177383521645395",
            "mccGroup": "Services",
            "hasEReceipt": false
        }
    }

One other theory I have is that we're too eagerly creating new reports here- I'm not 100% that the posted transactions hit this block, but we shouldn't create a new report if the nonReimbursable expense is an update to an existing one

https://github.com/Expensify/Web-Expensify/blob/main/lib/ReportAPI.php#L3189-L3193

grgia commented 4 weeks ago

Moving internal

grgia commented 4 weeks ago

thread here https://expensify.slack.com/archives/C036QM0SLJK/p1723021882407309

kevinksullivan commented 3 weeks ago

Georgia did some great investigation above ^^ and it sounds like we're displaying stale data on the frontend. @grgia , do you have next steps on how to move this one forward?

grgia commented 3 weeks ago

@kevinksullivan we've merged an initial fix for this one but Im working on fixing onyx updates here

melvin-bot[bot] commented 2 weeks ago

@kevinksullivan, @grgia, @ZhenjaHorbach Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] commented 2 weeks ago

@kevinksullivan, @grgia, @ZhenjaHorbach Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] commented 1 week ago

@kevinksullivan, @grgia, @ZhenjaHorbach 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

trjExpensify commented 1 week ago

The Auth PR is on prod, should this be closed now @grgia?

melvin-bot[bot] commented 1 week ago

@kevinksullivan, @grgia, @ZhenjaHorbach 10 days overdue. I'm getting more depressed than Marvin.

kevinksullivan commented 1 week ago

yup, think so. I also can't reproduce right now