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.48k stars 2.83k forks source link

"you don't have access to this room" error message displayed when group chat thread opened #50731

Open m-natarajan opened 4 days ago

m-natarajan commented 4 days 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: Reproducible in staging?: Needs Reproduction Reproducible in production?: Needs Reproduction 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: @puneetlath Slack conversation: https://expensify.slack.com/archives/C05LX9D6E07/p1728661697974329

Action Performed:

  1. Go to staging.new.expensify.com
  2. Open a group chat where you are a member

    Expected Result:

    User able to enter message in group chat and no error displayed

    Actual Result:

    The API returned a "you don't have access to this room" error and worked when commented again

    Workaround:

    Unknown

    Platforms:

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

    • [ ] Android: Native
    • [ ] Android: mWeb Chrome
    • [ ] iOS: Native
    • [ ] iOS: mWeb Safari
    • [x] MacOS: Chrome / Safari
    • [ ] MacOS: Desktop

Screenshots/Videos

image (2)

Add Comment API response that failed:

{ "code": 666, "jsonCode": 666, "type": "Expensify\\Libs\\Error\\ExpError", "UUID": "E490CD6D-46BF-4EE2-8B4F-51672557284A", "message": "You don't have access to this chat room.", "title": "Room not accessible", "data": { "onyxData": [ { "onyxMethod": "merge", "key": "reportActions_3634649718846583", "value": { "93999890068247772": { "errors": { "1728661529553049": "You don't have access to this chat room." } } } } ] }, "htmlMessage": "", "onyxData": [ { "onyxMethod": "merge", "key": "reportActions_3634649718846583", "value": { "93999890068247772": { "errors": { "1728661529553049": "You don't have access to this chat room." } } } } ], "requestID": "8d0ffa3e99af0f6b-EWR" }

Second one that succeeded:

{ "jsonCode": 200, "requestID": "8d0ffaa84b0d0f6b-EWR", "onyxData": [ { "key": "report_3634649718846583", "onyxMethod": "merge", "value": { "participants": { "2697693": { "hidden": false, "notificationPreference": "always", "role": "admin" }, "778531": { "hidden": true, "notificationPreference": "hidden", "role": "member" } } } }, { "key": "report_3634649718846583", "onyxMethod": "merge", "value": { "chatType": "group", "description": "", "lastActorAccountID": 778531, "lastMessageText": "firebase crash reports", "lastVisibleActionCreated": "2024-10-11 15:45:46.526", "managerID": null, "ownerAccountID": 0, "parentReportActionID": "451061726100912230", "parentReportID": "4160486413986541", "policyID": "_FAKE_", "reportID": "3634649718846583", "reportName": "THREAD Protect App Quality", "state": "OPEN", "stateNum": 0, "statusNum": 0, "type": "chat", "visibility": null } }, { "key": "reportActions_3634649718846583", "onyxMethod": "merge", "shouldShowPushNotification": true, "value": { "5311850144429338368": { "actionName": "ADDCOMMENT", "actorAccountID": 778531, "avatar": "https:\/\/d1wpcgnaa73g0y.cloudfront.net\/36e397299365c36a787b6084a641bd2fe1b28a58_128.jpeg", "created": "2024-10-11 15:45:46.526", "lastModified": "2024-10-11 15:45:46.526", "message": [ { "html": "firebase crash reports", "text": "firebase crash reports", "type": "COMMENT", "whisperedTo": [] } ], "originalMessage": { "html": "firebase crash reports", "isNewDot": true, "lastModified": "2024-10-11 15:45:46.526" }, "person": [ { "style": "strong", "text": "Puneet Lath", "type": "TEXT" } ], "reportActionID": "5311850144429338368", "shouldShow": true } } }, { "key": "personalDetailsList", "onyxMethod": "merge", "value": { "778531": { "accountID": 778531, "avatar": "https:\/\/d1wpcgnaa73g0y.cloudfront.net\/36e397299365c36a787b6084a641bd2fe1b28a58_128.jpeg", "displayName": "Puneet Lath", "firstName": "Puneet", "lastName": "Lath", "login": "puneet@expensify.com", "phoneNumber": "", "pronouns": "__predefined_heHimHis", "status": null, "timezone": { "automatic": true, "selected": "America\/New_York" }, "validated": true } } }, { "key": "reportActions_4160486413986541", "onyxMethod": "merge", "value": { "451061726100912230": { "childCommenterCount": 2, "childLastActorAccountID": null, "childLastMoneyRequestComment": null, "childLastReceiptTransactionIDs": null, "childLastVisibleActionCreated": "2024-10-11 15:45:46.526", "childMoneyRequestCount": null, "childOldestFourAccountIDs": "2697693,778531", "childRecentReceiptTransactionIDs": null, "childReportNotificationPreference": "hidden", "childStateNum": 0, "childStatusNum": 0, "childType": "chat", "childVisibleActionCount": 2 } } }, { "key": "report_3634649718846583", "onyxMethod": "merge", "value": { "notificationPreference": "always", "participants": { "778531": { "hidden": false, "notificationPreference": "always" } } } }, { "key": "reportActions_4160486413986541", "onyxMethod": "merge", "value": { "451061726100912230": { "childReportNotificationPreference": "always" } } }, { "key": "report_3634649718846583", "onyxMethod": "merge", "value": { "participants": { "2697693": { "hidden": false, "notificationPreference": "always", "role": "admin" }, "778531": { "hidden": false, "notificationPreference": "always", "role": "member" } } } }, { "key": "report_3634649718846583", "onyxMethod": "merge", "value": { "lastReadTime": "2024-10-11 15:45:46.526" } } ], "previousUpdateID": 2368467387, "lastUpdateID": 2368473805 }

Add any screenshot/video evidence

View all open jobs on GitHub

melvin-bot[bot] commented 4 days ago

Triggered auto assignment to @MonilBhavsar (AutoAssignerNewDotQuality)

melvin-bot[bot] commented 4 days ago

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

MelvinBot commented 4 days ago

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

muttmuure commented 3 days ago

@pasyukevich is this the same issue that you investigated before?

muttmuure commented 3 days ago

Dupe? https://expensify.slack.com/archives/C05LX9D6E07/p1725570547077669

pasyukevich commented 3 days ago

@muttmuure looks very similar

CortneyOfstad commented 3 days ago

I am not able to recreate. @muttmuure @pasyukevich @puneetlath — are you all able to recreate this?

muttmuure commented 3 days ago

https://github.com/Expensify/App/issues/48746

muttmuure commented 3 days ago

@pasyukevich do you mind checking if this has the same root cause, since you have context from the linked issue?

CortneyOfstad commented 3 days ago

@muttmuure I am heading OoO shortly (until 10/23) — would you be willing to keep an eye on this while I am out?

pasyukevich commented 2 days ago

sure, I'm taking a look

pasyukevich commented 2 days ago

I was able to recreate the issue

image
pasyukevich commented 2 days ago

This issue is quite different.

Logs are different from other similar issue. From this side, all looks good.

The problem for me looks like the BE issue - from the network tab I've inspected the request body and noticed that the difference between successful and rejected requests is minor. (key, time, and text itself)

pasyukevich commented 2 days ago

How I was able to reproduce after a few iterations:

  1. Open the app with different two logged accounts (from two different browsers on stage or the same but one from the incognito)
  2. Create a workspace where there will be both of them
  3. Enable 3g mode on both browsers from the network tab
  4. Send message from the account A to the workspace
  5. Once it shows for another user immediately send a few messages to the thread of the new message
  6. Observe the error
MonilBhavsar commented 1 day ago

Tried following this but could not repro.

https://github.com/user-attachments/assets/51d4d0d4-550b-4527-aa20-c95561da5f2b

I sus what's happening theoretically is - OpenReport is not finishing somehow and concurrently we queue an AddComment. At that time, report is not shared yet and hence we could not AddComment and see the error

MonilBhavsar commented 1 day ago

I thought blocking commit queue could be the reason for delay in processing OpenReport command, so tried on staging too, but no dice.

If anyone is able to reproduce please share the requestID of the OpenReport command that is triggered when opening the thread. Happy to look at the logs

pasyukevich commented 1 day ago

@MonilBhavsar I have this from yesterday - reportID 1005955096101416

image

I will try to reproduce it today and share the requestID

MonilBhavsar commented 1 day ago

I can take a look tomorrow, thanks. Is emailID of user A - slipway_cornice_01@icloud.com?

pasyukevich commented 1 day ago

Yes, it is correct