Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOLD for payment 2023-12-06] [$500] Web - Login - App crashes when login to HT account #31803

Closed
1 of 6 tasks
kbecciv opened this issue Nov 23, 2023 · 66 comments
Closed
1 of 6 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering Internal Requires API changes or must be handled by Expensify staff

Comments

@kbecciv
Copy link

kbecciv commented Nov 23, 2023

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: 1.4.3.0
Reproducible in staging?: y
Reproducible in production?: n
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: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Go to staging.new.expensify.com
  2. Login with HT account - [email protected]

Expected Result:

Verify the UI has a loading "skeleton" state (offline avatar and placeholder lines) and loads after a few moments and the loading state is not visible anymore

Actual Result:

App crashes

Workaround:

Unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6288979_1700775441466.Recording__256.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01eec53be34df7522e
  • Upwork Job ID: 1735048003260628992
  • Last Price Increase: 2023-12-13
@kbecciv kbecciv added the DeployBlockerCash This issue or pull request should block deployment label Nov 23, 2023
Copy link
Contributor

👋 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.

Copy link

melvin-bot bot commented Nov 23, 2023

📣 @github-actions[bot]! 📣
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>

Copy link

melvin-bot bot commented Nov 23, 2023

Triggered auto assignment to @aldo-expensify (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@situchan
Copy link
Contributor

@kbecciv do you have any crash log or console error?

@luacmartins
Copy link
Contributor

I suspect it might be coming from this PR - #31711. Gonna try to help @aldo-expensify reproduce this issue first

@luacmartins
Copy link
Contributor

Hmm actually, I'm seeing the crash log below without a HT account

Screenshot 2023-11-23 at 3 18 02 PM

@situchan
Copy link
Contributor

Seems like what @quinthar reported here

@luacmartins
Copy link
Contributor

luacmartins commented Nov 23, 2023

Seems to come from this line

const actorID = report.managerID || reportAction.actorAccountID;

@situchan
Copy link
Contributor

#31061 is candidate

@luacmartins
Copy link
Contributor

Yea, I'm trying to reproduce in dev

@aldo-expensify
Copy link
Contributor

Seems to come from this line

const actorID = report.managerID || reportAction.actorAccountID;

For this to happen, we would need to fail to find the IOU here

const lastIOUMoneyReport = _.find(
allSortedReportActions[iouReport.reportID],
(reportAction, key) =>
ReportActionUtils.shouldReportActionBeVisible(reportAction, key) &&
reportAction.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE &&
ReportActionUtils.isMoneyRequestAction(reportAction),
);

@luacmartins
Copy link
Contributor

luacmartins commented Nov 23, 2023

correct, this is the data I have. You can see that the reportID doesn't exist in allSortedReportActions and lastIOUMoneyReport is undefined

Screenshot 2023-11-23 at 3 52 53 PM

@aldo-expensify
Copy link
Contributor

Reproduced:

  1. Have 2 accounts logged in different sessions and start a chat between them
  2. Request money from one of them
  3. The other received the pusher event and crash

Going to check if this happens in production

@aldo-expensify
Copy link
Contributor

aldo-expensify commented Nov 23, 2023

hmm I have been only able to reproduce in dev, but not ~staging/~production

Reproduced in staging.

@aldo-expensify
Copy link
Contributor

hmm, pusher events are not working anymore in my env...

@luacmartins
Copy link
Contributor

luacmartins commented Nov 23, 2023

I have a fix for it here - https://github.com/Expensify/Web-Expensify/pull/39825

@aldo-expensify
Copy link
Contributor

This is the pusher events that cause the things to explode:

{
    "updates": [
        {
            "data": [
                {
                    "key": "report_3759538206565919",
                    "onyxMethod": "merge",
                    "value": {
                        "lastActorAccountID": 11033970,
                        "lastMentionedTime": null,
                        "lastMessageText": "$2.00 request",
                        "lastReadTime": null,
                        "lastVisibleActionCreated": "2023-11-23 23:11:15.398",
                        "maxSequenceNumber": 1,
                        "reportID": "3759538206565919"
                    }
                },
                {
                    "key": "reportActions_3759538206565919",
                    "onyxMethod": "merge",
                    "shouldNotify": true,
                    "value": {
                        "9135915664676949581": {
                            "actionName": "IOU",
                            "actorAccountID": 11033970,
                            "automatic": false,
                            "avatar": "https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/default-avatar_19.png",
                            "childReportID": 1130822545444080,
                            "childType": "chat",
                            "created": "2023-11-23 23:11:15.398",
                            "isAttachment": false,
                            "lastModified": "2023-11-23 23:11:15.398",
                            "message": [
                                {
                                    "html": "$2.00 request",
                                    "isDeletedParentAction": false,
                                    "isEdited": false,
                                    "reactions": [],
                                    "text": "$2.00 request",
                                    "type": "COMMENT",
                                    "whisperedTo": []
                                }
                            ],
                            "originalMessage": {
                                "IOUReportID": 3759538206565919,
                                "IOUTransactionID": "1282493847044555760",
                                "amount": 200,
                                "comment": "",
                                "currency": "USD",
                                "lastModified": "2023-11-23 23:11:15.398",
                                "participantAccountIDs": [
                                    11033970,
                                    11033972
                                ],
                                "type": "create"
                            },
                            "person": [
                                {
                                    "style": "strong",
                                    "text": "[email protected]",
                                    "type": "TEXT"
                                }
                            ],
                            "previousReportActionID": "7277686818659270939",
                            "reportActionID": "9135915664676949581",
                            "reportActionTimestamp": 1700781075398,
                            "sequenceNumber": 1,
                            "shouldShow": true,
                            "timestamp": 1700781075,
                            "whisperedToAccountIDs": []
                        }
                    }
                },
                {
                    "key": "report_3759538206565919",
                    "onyxMethod": "merge",
                    "value": {
                        "chatReportID": "5721531069860615",
                        "chatType": "",
                        "currency": "USD",
                        "description": null,
                        "hasOutstandingChildRequest": false,
                        "hasOutstandingIOU": true,
                        "hasParentAccess": true,
                        "iouReportID": null,
                        "isDeletedParentAction": null,
                        "isOwnPolicyExpenseChat": false,
                        "isPinned": false,
                        "isWaitingOnBankAccount": false,
                        "lastActorAccountID": 11033970,
                        "lastMentionedTime": null,
                        "lastMessageHtml": "$2.00 request",
                        "lastMessageText": "$2.00 request",
                        "lastReadSequenceNumber": 0,
                        "lastReadTime": null,
                        "lastVisibleActionCreated": "2023-11-23 23:11:15.398",
                        "lastVisibleActionLastModified": "2023-11-23 23:11:15.398",
                        "managerID": 11033972,
                        "nonReimbursableTotal": 0,
                        "notificationPreference": "always",
                        "oldPolicyName": "",
                        "ownerAccountID": 11033970,
                        "parentReportActionID": "5628178967538067842",
                        "parentReportID": "5721531069860615",
                        "participantAccountIDs": [
                            11033972,
                            11033970
                        ],
                        "policyID": "769D1BB08FEC917C",
                        "policyName": null,
                        "reportID": "3759538206565919",
                        "reportName": "IOU",
                        "stateNum": 1,
                        "statusNum": 1,
                        "submitterPayPalMeAddress": "",
                        "total": 200,
                        "type": "iou",
                        "visibility": null,
                        "visibleChatMemberAccountIDs": [],
                        "welcomeMessage": "",
                        "writeCapability": "all"
                    }
                },
                {
                    "key": "report_5721531069860615",
                    "onyxMethod": "merge",
                    "value": {
                        "iouReportID": "3759538206565919",
                        "participantAccountIDs": [
                            11033970
                        ]
                    }
                },
                {
                    "key": "transactions_1282493847044555760",
                    "onyxMethod": "merge",
                    "value": {
                        "amount": 200,
                        "billable": false,
                        "cardID": 11051,
                        "category": "",
                        "comment": {
                            "comment": ""
                        },
                        "created": "2023-11-23",
                        "currency": "USD",
                        "filename": "",
                        "hasEReceipt": false,
                        "merchant": "Request",
                        "modifiedAmount": 0,
                        "modifiedCreated": "",
                        "modifiedCurrency": "",
                        "modifiedMerchant": "",
                        "originalAmount": 0,
                        "originalCurrency": "",
                        "parentTransactionID": "",
                        "receipt": [],
                        "reimbursable": true,
                        "reportID": "3759538206565919",
                        "status": "Posted",
                        "tag": "",
                        "transactionID": "1282493847044555760"
                    }
                },
                {
                    "key": "report_5721531069860615",
                    "onyxMethod": "merge",
                    "value": {
                        "hasOutstandingChildRequest": true
                    }
                },
                {
                    "key": "report_5721531069860615",
                    "onyxMethod": "merge",
                    "value": {
                        "lastActorAccountID": 11033972,
                        "lastMentionedTime": null,
                        "lastMessageText": "[email protected] owes $2.00",
                        "lastReadTime": "2023-11-23 23:11:15.408",
                        "lastVisibleActionCreated": "2023-11-23 23:11:15.408",
                        "maxSequenceNumber": 2,
                        "reportID": "5721531069860615"
                    }
                },
                {
                    "key": "reportActions_5721531069860615",
                    "onyxMethod": "merge",
                    "shouldNotify": true,
                    "value": {
                        "5628178967538067842": {
                            "actionName": "REPORTPREVIEW",
                            "actorAccountID": 11033972,
                            "automatic": false,
                            "avatar": "https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/default-avatar_24.png",
                            "childMoneyRequestCount": 1,
                            "childReportID": 3759538206565919,
                            "childStateNum": 1,
                            "childStatusNum": 1,
                            "childType": "iou",
                            "created": "2023-11-23 23:11:15.408",
                            "isAttachment": false,
                            "lastModified": "2023-11-23 23:11:15.408",
                            "message": [
                                {
                                    "html": "[email protected] owes $2.00",
                                    "isDeletedParentAction": false,
                                    "isEdited": false,
                                    "reactions": [],
                                    "text": "[email protected] owes $2.00",
                                    "type": "COMMENT",
                                    "whisperedTo": []
                                }
                            ],
                            "originalMessage": {
                                "lastModified": "2023-11-23 23:11:15.408",
                                "linkedReportID": "3759538206565919"
                            },
                            "person": [
                                {
                                    "style": "strong",
                                    "text": "[email protected]",
                                    "type": "TEXT"
                                }
                            ],
                            "previousReportActionID": "6783530264347664382",
                            "reportActionID": "5628178967538067842",
                            "reportActionTimestamp": 1700781075408,
                            "sequenceNumber": 2,
                            "shouldShow": true,
                            "timestamp": 1700781075,
                            "whisperedToAccountIDs": []
                        }
                    }
                }
            ],
            "eventType": "onyxApiUpdate"
        }
    ],
    "lastUpdateID": "7550",
    "previousUpdateID": "7544"
}

We can see here:

  • REPORTPREVIEW is inserted to onyx in key reportActions_5721531069860615. This has "linkedReportID": "3759538206565919"
  • In the same Onyx event, another update inserts the IOU report 3759538206565919

I think the problem is that the REPORTPREVIEW gets inserted causing a re-render before the IOU report is inserted. I think we should just update the front end code so it doesn't crash and display something else while we don't find the IOU report

@luacmartins
Copy link
Contributor

Sounds good, wanna work on a fix?

@aldo-expensify
Copy link
Contributor

@luacmartins what are your thoughts on: #31806 🙏

@luacmartins
Copy link
Contributor

hmm but in the log I linked above iouReport is defined, we just don't have any reportAction for it in Onyx

@aldo-expensify
Copy link
Contributor

I think there is no payment to be issues here, I'll just close this since the offending PR was reverted.

@allroundexperts
Copy link
Contributor

Hi @aldo-expensify!

I reviewed #31817 and my payment is still pending. Can you please write a payment summary? Thanks

@aldo-expensify aldo-expensify added the Bug Something is broken. Auto assigns a BugZero manager. label Dec 12, 2023
Copy link

melvin-bot bot commented Dec 12, 2023

Triggered auto assignment to @muttmuure (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

Copy link

melvin-bot bot commented Dec 12, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@aldo-expensify
Copy link
Contributor

aldo-expensify commented Dec 12, 2023

@muttmuure added Bug because we need to process @allroundexperts 's payment for reviewing PR #31817

This issue is about a regression caused by PR: #31061

@allroundexperts
Copy link
Contributor

Thanks @aldo-expensify. Can you please write a payment summary?

@mallenexpensify mallenexpensify changed the title [HOLD for payment 2023-12-06] [HOLD for payment 2023-12-04] Web - Login - App crashes when login to HT account [HOLD for payment 2023-12-06] [$500] Web - Login - App crashes when login to HT account Dec 13, 2023
Copy link

melvin-bot bot commented Dec 13, 2023

⚠️ Could not update price automatically because there is no linked Upwork Job ID. The BZ team member will need to update the price manually in Upwork.

@mallenexpensify mallenexpensify added the Internal Requires API changes or must be handled by Expensify staff label Dec 13, 2023
Copy link

melvin-bot bot commented Dec 13, 2023

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

Copy link

melvin-bot bot commented Dec 13, 2023

Current assignee @allroundexperts is eligible for the Internal assigner, not assigning anyone new.

@mallenexpensify
Copy link
Contributor

Contributor+: @allroundexperts owed $500 via NewDot

@mallenexpensify
Copy link
Contributor

@allroundexperts can you complete the BZ checklist? Thx

@allroundexperts
Copy link
Contributor

Checklist

  1. This bug was caused by fix: fix lhn previews #31061. The author is aware of this bug.
  2. N/A
  3. N/A
  4. I think a regression test is not needed here because this involved a crash after just logging in to an account. This should be already covered in prior test cases.

@JmillsExpensify
Copy link

$500 payment approved for @allroundexperts based on summary above.

Copy link

melvin-bot bot commented Dec 18, 2023

@allroundexperts, @muttmuure, @aldo-expensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Dec 18, 2023
@aldo-expensify
Copy link
Contributor

@allroundexperts did you receive your payment?

@melvin-bot melvin-bot bot removed the Overdue label Dec 18, 2023
@mallenexpensify
Copy link
Contributor

This should all be wrapped up, so closing. Reply if you disagree!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering Internal Requires API changes or must be handled by Expensify staff
Projects
None yet
Development

No branches or pull requests

10 participants