Skip to content

[HOLD for payment 2025-02-04] [$250] Web - No login - first time go to Public room ulr, the link cut off leads to load infinitely #55239

Closed

Description

@lanitochka17

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: 9.0.85
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

Action Performed:

Precondition: Create a public room and copy URL

  1. Open browser which not login to Expensify
  2. Paste public room ulr and go

Expected Result:

Public room should open

Actual Result:

Page loads infinitely, ulr is changed to "https://staging.new.expensify.com/r"

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
Bug6709624_1736397135276.Recording__837.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021880330659956787723
  • Upwork Job ID: 1880330659956787723
  • Last Price Increase: 2025-01-17
Issue OwnerCurrent Issue Owner: @OfstadC

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 14, 2025
  2. melvin-bot commented on Jan 14, 2025

    @melvin-bot

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

  3. bernhardoj commented on Jan 15, 2025

    @bernhardoj
    Contributor

    Proposal

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

    App loads infinitely when opening public room as anonymous user.

    What is the root cause of that problem?

    When we open a public room while logged out, it will trigger the OpenReport and we will be logged in as anonymous user.

    App/src/libs/actions/Report.ts

    Lines 2866 to 2873 in 7b9e55e

    if (reportID && !isAuthenticated) {
    // Call the OpenReport command to check in the server if it's a public room. If so, we'll open it as an anonymous user
    openReport(reportID, '', [], undefined, '0', true);
    // Show the sign-in page if the app is offline
    if (networkStatus === CONST.NETWORK.NETWORK_STATUS.OFFLINE) {
    Onyx.set(ONYXKEYS.IS_CHECKING_PUBLIC_ROOM, false);
    }

    Then, the deep link to the public room will be handled after logged in and after the onboarding check.

    App/src/libs/actions/Report.ts

    Lines 2930 to 2934 in 7b9e55e

    isOnboardingFlowCompleted({
    onNotCompleted: startOnboardingFlow,
    onCompleted: handleDeeplinkNavigation,
    onCanceled: handleDeeplinkNavigation,
    });

    However, the above logic is never executed. The isOnboardingFlowStatusKnownPromise is never resolved.

    function isOnboardingFlowCompleted({onCompleted, onNotCompleted, onCanceled}: HasCompletedOnboardingFlowProps) {
    isOnboardingFlowStatusKnownPromise.then(() => {
    if (isEmptyObject(onboarding) || onboarding?.hasCompletedGuidedSetupFlow === undefined) {
    onCanceled?.();
    return;
    }

    It'll only be resolved if the nvp_onboarding data is available.

    function checkOnboardingDataReady() {
    if (onboarding === undefined) {
    return;
    }
    resolveOnboardingFlowStatus();
    }

    However, it's never available for anonymous users. So, the app will by default open with a report screen but without a reportID. We already have a logic to fill the reportID if it's missing by finding the last accessed report, but since we logged in as a new anon user, the public room is never accessed yet, so it returns nothing.

    const lastAccessedReportID = ReportUtils.findLastAccessedReport(!canUseDefaultRooms, !!route.params.openOnAdminRoom, activeWorkspaceID)?.reportID;
    // It's possible that reports aren't fully loaded yet
    // in that case the reportID is undefined
    if (!lastAccessedReportID) {
    return;
    }
    Log.info(`[ReportScreen] no reportID found in params, setting it to lastAccessedReportID: ${lastAccessedReportID}`);
    navigation.setParams({reportID: lastAccessedReportID});

    But it's not the problem here because the normal flow would be open public room -> logged in -> public room is shown, thus the report is read.

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

    We need to update the link handling. If it's an anonymous user, we don't need to check for onboarding data and just execute the link.

    App/src/libs/actions/Report.ts

    Lines 2929 to 2934 in 7b9e55e

    // We need skip deeplinking if the user hasn't completed the guided setup flow.
    isOnboardingFlowCompleted({
    onNotCompleted: startOnboardingFlow,
    onCompleted: handleDeeplinkNavigation,
    onCanceled: handleDeeplinkNavigation,
    });

    if (isAnonymousUser()) {
        handleDeeplinkNavigation();
        return;
    }
    // We need skip deeplinking if the user hasn't completed the guided setup flow.
    isOnboardingFlowCompleted({
        onNotCompleted: startOnboardingFlow,
        onCompleted: handleDeeplinkNavigation,
        onCanceled: handleDeeplinkNavigation,
    });
    

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

    N/A

    What alternative solutions did you explore? (Optional)

    If there is no last access/read report, fallback to the first report available.

    return adminReport ?? lastRead;

    return adminReport ?? lastRead ?? reportsValues[0];
    
  4. OfstadC commented on Jan 15, 2025

    @OfstadC
    Contributor

    Will test this afternoon

  5. OfstadC commented on Jan 17, 2025

    @OfstadC
    Contributor

    Was able to reproduce with this link

    Image
  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jan 17, 2025
  7. melvin-bot commented on Jan 17, 2025

    @melvin-bot
  8. changed the title [-]Web - No login - first time go to Public room ulr, the link cut off leads to load infinitely[/-] [+][$250] Web - No login - first time go to Public room ulr, the link cut off leads to load infinitely[/+] on Jan 17, 2025
  9. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 17, 2025
  10. melvin-bot commented on Jan 17, 2025

    @melvin-bot

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

  11. hungvu193 commented on Jan 18, 2025

    @hungvu193
    Contributor

    Will review today!

  12. 15 remaining items

  13. melvin-bot commented on Jan 28, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.89-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2025-02-04. 🎊

    For reference, here are some details about the assignees on this issue:

    • @hungvu193 requires payment through NewDot Manual Requests
    • @bernhardoj requires payment through NewDot Manual Requests
  14. melvin-bot commented on Jan 28, 2025

    @melvin-bot

    @hungvu193 @OfstadC @hungvu193 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  15. moved this from Bugs and Follow Up Issues to Hold for Payment in #expensify-bugson Jan 28, 2025
  16. OfstadC commented on Jan 28, 2025

    @OfstadC
    Contributor

    @hungvu193 Please complete BZ Checklist prior to payment date! Thanks!

  17. hungvu193 commented on Feb 3, 2025

    @hungvu193
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to comment: https://github.com/Expensify/App/pull/47097/files#r1938703740

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion: N/A

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    Regression Test Proposal

    Precondition:

    Test:

    1. Create a public room and copy the url.
    2. Open the cognito tab and paste the url.
    3. Verify that public room will be opened.

    Do we agree 👍 or 👎

  18. melvin-bot commented on Feb 4, 2025

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@OfstadC)

    • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1880330659956787723/hired)
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  19. OfstadC commented on Feb 4, 2025

    @OfstadC
    Contributor

    Payment Summary accurate

  20. moved this from Hold for Payment to Done in #expensify-bugson Feb 4, 2025
  21. bernhardoj commented on Feb 5, 2025

    @bernhardoj
    Contributor

    Requested in ND.

  22. JmillsExpensify commented on Feb 10, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @bernhardoj

  23. garrettmknight commented on Feb 11, 2025

    @garrettmknight
    Contributor

    $250 approved for @hungvu193

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions