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

[CRITICAL] [UX Reliability] Sometimes new users has 2 concierge chats after first sign up #42729

Closed
6 tasks
mountiny opened this issue May 28, 2024 · 18 comments
Closed
6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Needs Reproduction Reproducible steps needed

Comments

@mountiny
Copy link
Contributor

mountiny commented May 28, 2024

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.75-1
Reproducible in staging?:
Reproducible in production?:
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:
Slack conversation: https://expensify.slack.com/archives/C05LX9D6E07/p1717178036627669?thread_ts=1716934948.607449&cid=C05LX9D6E07
Time of bug report: 2024-05-28 3:22pm PDT

Action Performed:

Break down in numbered steps

  1. As Alice request money from user that does not have account yet (Bob)

  2. As Bob, you will receive an email with this request

  3. image
  4. Click Pay and verify you are redirected to the login screen

  5. Log in as Bob

  6. Check out chats in the LHN

Expected Result:

Describe what you think should've happened

There should only be one Concierge chat

Actual Result:

Describe what actually happened

There are two chats that we essentially concierge chat. One of them however looks weird like this
image

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

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

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @neil-marcellini
@mountiny mountiny added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 28, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label May 28, 2024
Copy link

melvin-bot bot commented May 28, 2024

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

Copy link

melvin-bot bot commented May 28, 2024

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

@mountiny
Copy link
Contributor Author

Adding to newdot-quality

Noting that this might be a race condition, so it's not always reproducible. It seems like the odd chat might be created optimistically, and we get the correct concierge chat later in the OpenApp response. This needs to be investigated

@Christinadobrzyn Christinadobrzyn added the Needs Reproduction Reproducible steps needed label May 30, 2024
@MelvinBot
Copy link

This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

@Christinadobrzyn
Copy link
Contributor

hey @mountiny I'm wondering if this might be the same root? - #42321

I tried to reproduce this through these steps;

I'm not getting any email... I wonder if this needs to be tested in dev?

@mountiny
Copy link
Contributor Author

I think this is specific about the Concierge chat being duplicated

@neil-marcellini neil-marcellini self-assigned this May 30, 2024
@neil-marcellini
Copy link
Contributor

Hey there, I'm jumping in to help investigate this internally.

@neil-marcellini
Copy link
Contributor

First I tried testing a very simple case on dev to see if I could reproduce the error. I used these steps.

  1. Log in with an existing account A
  2. Submit a manual expense to a new account B
  3. Log in as account B
  4. Check the LHN

The concierge chat appeared fine, so next I'll test with the exact steps in the description. I think it was helpful to rule out the simple case first.

@neil-marcellini
Copy link
Contributor

I'm unable to reproduce the error on dev following the exact flow described.
image

@mountiny
Copy link
Contributor Author

@neil-marcellini I have just reproed locally something weird potentially related.

  1. Create account in oldDot for new account which was never used before
  2. Sign into the same account in NewDot
  3. There was some weird chat I was navigated to

I was not able to repro again though, really odd, not sure what is causing this

@neil-marcellini
Copy link
Contributor

The thread where we're discussing this now is here.

The reportIDs of the concierge chat with two users, and with only concierge, are these values respectively 3201626641067399, 6655774248117393.

I extracted that from the video @danielrvidal shared.

As Puneet suggested, I'm going to determine if these chats actually exist in the DB or if they are optimistic. I'll try with supportal first, then maybe request CQs if that fails. The email of the account is [email protected].

@neil-marcellini
Copy link
Contributor

For the concierge chat report which included the current account 3201626641067399, I get that the report was not found. Therefore it was an optimistic report.
Google Chrome 2024-05-31 16 07 54

For the other report 6655774248117393, I get a response suggesting that the report actually exists, although OldDot shows an endless spinner, but that's probably just because OldDot doesn't load chat reports properly.

Here is the response
{
    "jsonCode": 200,
    "reports": {
        "6655774248117393": {
            "accountEmail": "__fake__",
            "accountID": 0,
            "approved": "",
            "cachedData": "",
            "cachedTotal": "$0.00",
            "created": "2024-05-28 22:16:42",
            "currency": "USD",
            "entryID": "",
            "isStatementReport": false,
            "managerEmail": "__fake__",
            "managerID": 0,
            "orderDealNumbers": "",
            "reportID": 6655774248117393,
            "reportName": "Chat Report",
            "reportStatus": 0,
            "starred": false,
            "state": "OPEN",
            "stateNum": 0,
            "status": 0,
            "submitted": "",
            "transactionCount": 0,
            "transactionList": [],
            "reportNameValuePairs": {
                "expensify_policyID": "_FAKE_",
                "lastReadTime_17304561": "2024-05-28 22:16:42.359",
                "type": "chat"
            },
            "reportActionList": [
                {
                    "accountEmail": "__fake__",
                    "accountID": "0",
                    "action": "CREATED",
                    "created": "2024-05-28 22:16:42.358",
                    "message": {
                        "creatorAccountID": 17304561,
                        "lastModified": "2024-05-28 22:16:42.358"
                    },
                    "previousReportActionID": "0",
                    "reportActionID": "6162605927137434213",
                    "reportID": 6655774248117393,
                    "sequenceNumber": 0
                },
                {
                    "accountEmail": "[email protected]",
                    "accountID": "8392101",
                    "action": "ADDCOMMENT",
                    "created": "2024-05-28 22:16:43.452",
                    "message": {
                        "html": "<h1>Welcome to Expensify<\/h1>\ud83d\udc4b Hey there, I'm Concierge! If you have any questions about Expensify, you can always chat with me here 24-7 for fast and reliable support. I'm happy to help!",
                        "lastModified": "2024-05-28 22:16:43.452"
                    },
                    "previousReportActionID": "6162605927137434213",
                    "reportActionID": "5027620404823866902",
                    "reportID": 6655774248117393,
                    "sequenceNumber": 1
                },
                {
                    "accountEmail": "[email protected]",
                    "accountID": "8392101",
                    "action": "ADDCOMMENT",
                    "created": "2024-05-30 08:29:33.160",
                    "message": {
                        "html": "<h1>What will you use Expensify for?<\/h1>Choose the features you need and I can help get you up and running <a href=\"https:\/\/www.expensify.com\/inbox?policyID=AE6F7AFE6B942647&amp;taskID=WelcomeBusiness\" target=\"_blank\" rel=\"noreferrer noopener\">here.<\/a> For questions, just reply to this message or <a href=\"https:\/\/www.expensify.com\/inbox?policyID=AE6F7AFE6B942647&amp;calltaskID=WelcomeBusiness\" target=\"_blank\" rel=\"noreferrer noopener\">request a call<\/a>.",
                        "isMarketingMessage": true,
                        "lastModified": "2024-05-30 08:29:33.160"
                    },
                    "previousReportActionID": "5027620404823866902",
                    "reportActionID": "3884547479339066364",
                    "reportID": 6655774248117393,
                    "sequenceNumber": 2
                }
            ],
            "sharedReportList": [
                {
                    "accountID": 17304561,
                    "email": "[email protected]",
                    "permissions": "read, write"
                },
                {
                    "accountID": 8392101,
                    "email": "[email protected]",
                    "permissions": "read, write"
                }
            ],
            "publicRoomActors": [],
            "mentionedReportsDetails": [],
            "mentionedAccountsPersonalDetails": [],
            "fieldList": [],
            "comments": [],
            "showChart": false,
            "formattedTotal": "$0.00",
            "starting": "2027-08-02",
            "ending": "1970-01-01",
            "editable": true,
            "ownerEmail": "__fake__",
            "ownerAccountID": 0,
            "lastVisibleActionCreated": "2024-05-30 08:29:33.160",
            "lastReadTime": "2024-05-28 22:16:42.359",
            "violations": [],
            "nextStep": {
                "buttons": [],
                "message": [
                    {
                        "text": "Waiting for "
                    },
                    {
                        "text": "__fake__",
                        "type": "strong",
                        "tooltipText": "__fake__ (click to copy)",
                        "clickToCopyText": "__fake__"
                    },
                    {
                        "text": " to "
                    },
                    {
                        "text": "add expenses",
                        "type": "strong"
                    },
                    {
                        "text": " to this report."
                    }
                ],
                "title": "Next Step:",
                "requiresUserAction": false,
                "type": null,
                "showUndoSubmit": false,
                "showForMobile": true,
                "showForExpense": true,
                "expenseMessage": [],
                "nextReceiver": ""
            }
        }
    },
    "globals": {
        "csrfToken": "nem9+RNPHk7UfMiVirxeV4BJOXw8l5SdVPCfSOzRdloZypC9kG7uMvqyOg5wr4Sg7J\/m1EZQMKu4+NoOHh3Sa4Ftjdu8\/\/DLeIdHzTrnDXX\/NBmcJ34HzkvPsqleWbQKmu4HeTrjaMajoHo0aCeC9KpSCPJF\/eRZEshBbJEM"
    },
    "codeRevision": "eb1b5ef0cef7d0ef467cd0405232442f7958889e",
    "requestID": "88caa0720bcaf9f9-SJC"
}

I will continue my investigation by looking at how an optimistic concierge chat report might get created.

@neil-marcellini
Copy link
Contributor

I think this is where the optimistic concierge chat could be coming from, but I need to dig deeper to determine how things might go wrong. Definitely seems like some kind of a race condition. I ran out of time for today.

@kosmydel
Copy link
Contributor

kosmydel commented Jun 3, 2024

Hello, I'm Jakub from the Software Mansion expert's agency. I've been trying to reproduce an issue, but I'm not receiving any emails when requesting money (splitting an expense). I've attempted this with 2 different email accounts and waited over 15 minutes. I'm not sure if this is a problem with my email account or with outgoing Expensify emails (magic code emails are working fine for me).

I will try again later, as I cannot proceed without this email.

@melvin-bot melvin-bot bot added the Overdue label Jun 3, 2024
@neil-marcellini
Copy link
Contributor

Hi Jakub, I also experienced the same issue when trying to reproduce on staging. I'll test once more today and if I don't get an email I will create a separate backend issue to investigate that.

@melvin-bot melvin-bot bot removed the Overdue label Jun 3, 2024
@neil-marcellini
Copy link
Contributor

I'm going to write out the entire frontend flow relating to concierge chats.

The first thing to look at is where are optimistic concierge chats created?
Optimistic chat reports are created with the function buildOptimisticChatReport.
That function is used in many places, but only navigateToAndOpenReport is relevant
It's used by navigateToConciergeChat
That's called from the Concierge page
It's part of the AuthScreens, so it will only show after the user has logged in
The call in the Concierge page runs in a focus effect, which runs when the component is mounted and focused

If the navigation is ready and the component is still mounted, then the function is called
Within navigateToConciergeChat it checks if the conciergeChatReportID is unset, and if so calls onServerDataReady with a callback.

onServerDataReady just returns the isServerDataReadyPromise, which is tied to the value of resolveIsReadyPromise, which is called by checkServerDataReady when ONYXKEYS.IS_LOADING_REPORT_DATA is updated with the value false.

Shoot, so after testing, I see that the Concierge page only mounts if you navigate to https://dev.new.expensify.com:8082/concierge, and it doesn't happen in this flow.

I looked at the other uses of navigateToConciergeChat and they don't look promising. Not sure what do do here. Maybe I can get logs for the actual flow in the bug report?

@neil-marcellini
Copy link
Contributor

Aha, I found App logs from the bug report video.

The report that the pay button navigates to is reportID 2524712465763561.

I'm still lost on this one though, so maybe I should look carefully at the flow which happens when you navigate to a report while logged out. It kind of looks like the report was in Onyx before he even signed in, because it loads surprisingly fast.

I think it would be easy to waste a lot of time on this, so I'm suggesting in Slack that we close or hold this and focus on why we can't get emails for new chats.

@neil-marcellini
Copy link
Contributor

Closing this out since it's not reproducible and we don't really have any leads on how to solve it. One thing we did learn is that emails for new money requests are not sent to expensifail users.

@github-project-automation github-project-automation bot moved this from CRITICAL to Done in [#whatsnext] #quality Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Needs Reproduction Reproducible steps needed
Projects
Development

No branches or pull requests

6 participants