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

[$250] Room - App crashes when logging in to a new account via public room #55315

Open
3 of 8 tasks
lanitochka17 opened this issue Jan 15, 2025 · 10 comments
Open
3 of 8 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

Comments

@lanitochka17
Copy link

lanitochka17 commented Jan 15, 2025

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: 9.0.86-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team
Component: Other

Action Performed:

  1. Go to staging.new.expensify.com
  2. Log out if logged in
  3. Navigate to a public room (https://staging.new.expensify.com/r/917109272907402
    ).
  4. Navigate to the same public room again (because it does not load on first try).
  5. Click Sign in
  6. Enter a new Gmail account
  7. Click Join

Expected Result:

App will not crash

Actual Result:

App crashes

Workaround:

Unknown

Platforms:

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

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Bug6715070_1736971047097.20250116_035432.mp4

logs3.txt

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021879902166827016950
  • Upwork Job ID: 1879902166827016950
  • Last Price Increase: 2025-01-16
Issue OwnerCurrent Issue Owner: @ishpaul777
@lanitochka17 lanitochka17 added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 labels Jan 15, 2025
Copy link

melvin-bot bot commented Jan 15, 2025

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

@bernhardoj
Copy link
Contributor

Proposal

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

App crashes when logging in from anonymous user on a public room.

What is the root cause of that problem?

When we log in, the app will trigger an OpenApp request. The OpenApp returns the onyx command of set collection of reports.

Image

The problem is, that it doesn't include the public room, so it's removed from the onyx. And it crashes here because the reportID is previously the public room, but since it's now removed by the OpenApp, the reportID becomes an empty string, causing the error.

const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`);

const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`);

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

We have 2 options to solve it. First, fallback to CONST.DEFAULT_NUMBER_ID.

const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID || CONST.DEFAULT_NUMBER_ID}`);

Or

We can remove the empty string fallback here, so the reportID passed down to both components are undefined and won't cause an error when the key changes from report_xxx to report_undefined.

const reportID = report?.reportID ?? '';

This fixes the crash, but the user will see a not found page because the OpenApp "removes" the public room. So this must be fixed on the BE probably.

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

N/A

@maddylewis maddylewis added the External Added to denote the issue can be worked on by a contributor label Jan 16, 2025
@melvin-bot melvin-bot bot changed the title Room - App crashes when logging in to a new account via public room [$250] Room - App crashes when logging in to a new account via public room Jan 16, 2025
Copy link

melvin-bot bot commented Jan 16, 2025

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 16, 2025
Copy link

melvin-bot bot commented Jan 16, 2025

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

@etCoderDysto
Copy link
Contributor

Same RCA as #55055

Copy link

melvin-bot bot commented Jan 20, 2025

@maddylewis, @ishpaul777 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 Jan 20, 2025
@ishpaul777
Copy link
Contributor

reviewing today

@melvin-bot melvin-bot bot removed the Overdue label Jan 20, 2025
@ishpaul777
Copy link
Contributor

ishpaul777 commented Jan 23, 2025

@bernhardoj proposal fixes the crash and sounds good from FE side but we should investigate why OpenReport returns error for the public report

Details

Screen.Recording.2025-01-23.at.5.51.39.PM.mov
{
    "code": 666,
    "jsonCode": 666,
    "type": "Expensify\\Libs\\Error\\ExpError",
    "UUID": "5CBABCBB-13F3-4535-9AB2-28C50BDDD7A2",
    "message": "Auth OpenReport returned an error",
    "title": "",
    "data": {
        "onyxData": [
            {
                "onyxMethod": "merge",
                "key": "report_917109272907402",
                "value": {
                    "errorFields": {
                        "createChat": {
                            "1737634914136050": "Auth OpenReport returned an error"
                        }
                    }
                }
            }
        ]
    },
    "htmlMessage": "",
    "onyxData": [
        {
            "onyxMethod": "merge",
            "key": "report_917109272907402",
            "value": {
                "errorFields": {
                    "createChat": {
                        "1737634914136050": "Auth OpenReport returned an error"
                    }
                }
            }
        }
    ],
    "requestID": "9067bf042e8e59b4-DEL"
}

🎀 👀 🎀

Copy link

melvin-bot bot commented Jan 23, 2025

Triggered auto assignment to @srikarparsi, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@allgandalf
Copy link
Contributor

coming from here, @ishpaul777 aren't both the issues related to each other?

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
Projects
None yet
Development

No branches or pull requests

7 participants