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 2025-02-04] [$250] Web - No login - first time go to Public room ulr, the link cut off leads to load infinitely #55239

Closed
1 of 8 tasks
lanitochka17 opened this issue Jan 14, 2025 · 20 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Jan 14, 2025

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
@lanitochka17 lanitochka17 added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 labels Jan 14, 2025
Copy link

melvin-bot bot commented Jan 14, 2025

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.

@bernhardoj
Copy link
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];

@OfstadC
Copy link
Contributor

OfstadC commented Jan 15, 2025

Will test this afternoon

@OfstadC
Copy link
Contributor

OfstadC commented Jan 17, 2025

Was able to reproduce with this link

Image

@OfstadC OfstadC added the External Added to denote the issue can be worked on by a contributor label Jan 17, 2025
Copy link

melvin-bot bot commented Jan 17, 2025

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

@melvin-bot melvin-bot bot 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 Jan 17, 2025
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 17, 2025
Copy link

melvin-bot bot commented Jan 17, 2025

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

@hungvu193
Copy link
Contributor

Will review today!

@hungvu193
Copy link
Contributor

Thanks @bernhardoj. Your proposal looks good to me!

🎀 👀 🎀

Copy link

melvin-bot bot commented Jan 20, 2025

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

@garrettmknight garrettmknight moved this to Bugs and Follow Up Issues in [#whatsnext] #expense Jan 21, 2025
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 21, 2025
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jan 22, 2025
@bernhardoj
Copy link
Contributor

PR is ready

cc: @hungvu193

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jan 28, 2025
@melvin-bot melvin-bot bot changed the title [$250] Web - No login - first time go to Public room ulr, the link cut off leads to load infinitely [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 Jan 28, 2025
Copy link

melvin-bot bot commented Jan 28, 2025

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jan 28, 2025
Copy link

melvin-bot bot commented Jan 28, 2025

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

Copy link

melvin-bot bot commented Jan 28, 2025

@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]

@garrettmknight garrettmknight moved this from Bugs and Follow Up Issues to Hold for Payment in [#whatsnext] #expense Jan 28, 2025
@OfstadC
Copy link
Contributor

OfstadC commented Jan 28, 2025

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

@hungvu193 hungvu193 mentioned this issue Feb 3, 2025
50 tasks
@hungvu193
Copy link
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 👎

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Feb 3, 2025
Copy link

melvin-bot bot commented Feb 4, 2025

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

@OfstadC
Copy link
Contributor

OfstadC commented Feb 4, 2025

Payment Summary accurate

@OfstadC OfstadC closed this as completed Feb 4, 2025
@github-project-automation github-project-automation bot moved this from Hold for Payment to Done in [#whatsnext] #expense Feb 4, 2025
@bernhardoj
Copy link
Contributor

Requested in ND.

@JmillsExpensify
Copy link

$250 approved for @bernhardoj

@garrettmknight
Copy link
Contributor

$250 approved for @hungvu193

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 External Added to denote the issue can be worked on by a contributor
Projects
Status: Done
Development

No branches or pull requests

7 participants