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

[PAY 7TH SEP][$250] Sign In - User navigated to deeplink conversation instead LHN when Signed out and back in #47428

Closed
5 of 6 tasks
IuliiaHerets opened this issue Aug 14, 2024 · 41 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

@IuliiaHerets
Copy link

IuliiaHerets commented Aug 14, 2024

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.19-10
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4849362&group_by=cases:section_id&group_order=asc&group_id=229066
Email or phone of affected tester (no customers): applausetester+omqq1@applause.expensifail.com
Issue reported by: Applause Internal Team

Action Performed:

Precondition: User should be signed out. If using the web version, please resize the window to portrait format (mWeb).

  1. Open app
  2. Navigate to a deeplink that leads to a conversation with another user.
  3. Sign in with a valid account that has the conversation from step 2
  4. Sign Out
  5. Sign In back (do not use the deeplink)

Expected Result:

User should be navigated to LHN

Actual Result:

When the user signed out and back in (step 5), the conversation from the deeplink in step 2 opened.

Workaround:

Unknown

Platforms:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6571122_1723567808589.RPReplay_Final1723567720.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01bf4c9f6cbc29f247
  • Upwork Job ID: 1823967796772847704
  • Last Price Increase: 2024-08-15
  • Automatic offers:
    • DylanDylann | Reviewer | 103625928
Issue OwnerCurrent Issue Owner: @DylanDylann
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 14, 2024
Copy link

melvin-bot bot commented Aug 14, 2024

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

@IuliiaHerets
Copy link
Author

We think that this bug might be related to #vip-vsb

@IuliiaHerets
Copy link
Author

@jliexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@jliexpensify
Copy link
Contributor

@IuliiaHerets can you retest this one on v9.0.20-6? I haven't been able to repro.

@IuliiaHerets IuliiaHerets changed the title Sign In - User navigated to deeplink conversation when signed out and signed in back Sign In - User navigated to deeplink conversation instead LHN when Signed out and back in Aug 15, 2024
@IuliiaHerets
Copy link
Author

Tester update steps a little for better understanding:
Precondition: User should be signed out. If using the web version, please resize the window to portrait format (mWeb).

  1. Open app
  2. Navigate to a deeplink that leads to a conversation with another user.
  3. Sign in with a valid account that has the conversation from step 2
  4. Sign Out
  5. Sign In back (do not use the deeplink).

Issue still reproduce on his side on the iOS 9.0.20-6 build.

RPReplay_Final1723697172.mp4

@jliexpensify
Copy link
Contributor

Ok, I can reproduce it on Android but not on web.

@jliexpensify jliexpensify added the External Added to denote the issue can be worked on by a contributor label Aug 15, 2024
@melvin-bot melvin-bot bot changed the title Sign In - User navigated to deeplink conversation instead LHN when Signed out and back in [$250] Sign In - User navigated to deeplink conversation instead LHN when Signed out and back in Aug 15, 2024
Copy link

melvin-bot bot commented Aug 15, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 15, 2024
Copy link

melvin-bot bot commented Aug 15, 2024

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

@jliexpensify
Copy link
Contributor

#vsb is deprioritised, but this seems like an issue with a core flow (i.e. not using a deeplink drops you into the chat) so I think we should look into fixing it.

@bernhardoj
Copy link
Contributor

Proposal

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

After login with a deep link then logout and login again, the app opens the previous deeplink page.

What is the root cause of that problem?

When we open a deeplink while logged out, it will wait until the user signs in first and then connects to the ONBOARDING onyx before navigating to the deeplink.

App/src/libs/actions/Report.ts

Lines 2668 to 2709 in 6e61b1a

InteractionManager.runAfterInteractions(() => {
Session.waitForUserSignIn().then(() => {
Onyx.connect({
key: ONYXKEYS.NVP_ONBOARDING,
callback: (onboarding) => {
Navigation.waitForProtectedRoutes().then(() => {
if (route && Session.isAnonymousUser() && !Session.canAnonymousUserAccessRoute(route)) {
Session.signOutAndRedirectToSignIn(true);
return;
}
// We don't want to navigate to the exitTo route when creating a new workspace from a deep link,
// because we already handle creating the optimistic policy and navigating to it in App.setUpPoliciesAndNavigate,
// which is already called when AuthScreens mounts.
if (new URL(url).searchParams.get('exitTo') === ROUTES.WORKSPACE_NEW) {
return;
}
if (shouldSkipDeepLinkNavigation(route)) {
return;
}
const state = navigationRef.getRootState();
const currentFocusedRoute = findFocusedRoute(state);
const hasCompletedGuidedSetupFlow = hasCompletedGuidedSetupFlowSelector(onboarding);
// We need skip deeplinking if the user hasn't completed the guided setup flow.
if (!hasCompletedGuidedSetupFlow) {
Welcome.isOnboardingFlowCompleted({onNotCompleted: () => Navigation.navigate(ROUTES.ONBOARDING_ROOT.getRoute())});
return;
}
if (isOnboardingFlowName(currentFocusedRoute?.name)) {
Welcome.setOnboardingErrorMessage(Localize.translateLocal('onboarding.purpose.errorBackButton'));
return;
}
if (isAuthenticated) {
return;
}
Navigation.navigate(route as Route, CONST.NAVIGATION.ACTION_TYPE.PUSH);

When we log out, the onyx connection still persists, and because it captures the previous deeplink, whenever the onboarding value changes, the previous deeplink is triggered again, including when we login in again.

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

Disconnect the Onyx connection once we are done with the deeplink.

App/src/libs/actions/Report.ts

Lines 2708 to 2709 in 6e61b1a

Navigation.navigate(route as Route, CONST.NAVIGATION.ACTION_TYPE.PUSH);

const connectionID = Onyx.connect({
    ...,
    callback: () => {
        ...
        Onyx.disconnect(connectionID);
        Navigation.navigate(route as Route, CONST.NAVIGATION.ACTION_TYPE.PUSH);
    }
});

@kundan175
Copy link

Hello @jliexpensify @bernhardoj @IuliiaHerets @DylanDylann @r8

This problem started occurring for me 3 days ago. If the user is logged out and comes through deep linking, it directly redirects them in, but if they log out and then log back in, it redirects again.

This issue happens because the linking was not cleared after being used. After using the linking, you need to remove the linking data. I have fixed this issue in your app.

Copy link

melvin-bot bot commented Aug 15, 2024

📣 @kundan175! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

Copy link

melvin-bot bot commented Aug 15, 2024

⚠️ Invalid email. Please make sure to create an Expensify account with this email first here.

Copy link

melvin-bot bot commented Aug 15, 2024

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@jliexpensify
Copy link
Contributor

Hi @kundan175 - can you please submit a proposal, like what the other contributor has done? All the details to write and submit a proposal can be found in our contributing.MD:

https://github.com/Expensify/App/blob/main/contributingGuides/CONTRIBUTING.md

@kundan175
Copy link

@jliexpensify To be honest, I didn't understand it either. This is the first time I've seen something like this in the Guides 😊.

@kundan175
Copy link

@jliexpensify But I can fix this issue. In fact, I fixed a similar issue 2 days ago in this app: Juggle NZ - Shop, Earn & Reward.

@jliexpensify
Copy link
Contributor

@kundan175 please review the Contributor .MD and write a proposal as to how you will fix the issue for review. Thanks!

@kundan175
Copy link

@jliexpensify
Problem Statement
We are trying to solve an issue where, if the user is logged out and then logs back in through deep linking, the app redirects them again by again.

Root Cause
The root cause of this problem is that the linking data was not cleared after it was used, causing the app to trigger the redirection multiple times.

Proposed Solution
To solve this problem, the linking data should be removed immediately after it is used to prevent unnecessary redirects.

Alternative Solutions Explored (Optional)
None needed at this time, as clearing the linking data is a straightforward and effective solution.

@r8
Copy link
Collaborator

r8 commented Aug 15, 2024

Why am I lately constantly getting mentioned in issues here?

Copy link

melvin-bot bot commented Aug 15, 2024

📣 @r8! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@DylanDylann
Copy link
Contributor

@bernhardoj's proposal looks good to me. We need to disconnect to Onyx when navigating successful

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Aug 21, 2024

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

@neil-marcellini
Copy link
Contributor

@bernhardoj's proposal looks good to me. We need to disconnect to Onyx when navigating successful

🎀 👀 🎀 C+ reviewed

I agree, sounds good.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 21, 2024
Copy link

melvin-bot bot commented Aug 21, 2024

📣 @DylanDylann 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@bernhardoj
Copy link
Contributor

PR is ready

cc: @DylanDylann

Copy link

melvin-bot bot commented Aug 27, 2024

@neil-marcellini, @jliexpensify, @bernhardoj, @DylanDylann Huh... This is 4 days overdue. Who can take care of this?

@melvin-bot melvin-bot bot added the Overdue label Aug 27, 2024
@DylanDylann
Copy link
Contributor

The PR is merged

@melvin-bot melvin-bot bot removed the Overdue label Aug 28, 2024
Copy link

melvin-bot bot commented Aug 28, 2024

@neil-marcellini @jliexpensify @bernhardoj @DylanDylann this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

Copy link

melvin-bot bot commented Sep 2, 2024

@neil-marcellini, @jliexpensify, @bernhardoj, @DylanDylann Huh... This is 4 days overdue. Who can take care of this?

@melvin-bot melvin-bot bot added the Overdue label Sep 2, 2024
@jliexpensify
Copy link
Contributor

Hmm automation broken - deployed to prod on 31st Aug, right?

@jliexpensify jliexpensify changed the title [$250] Sign In - User navigated to deeplink conversation instead LHN when Signed out and back in [PAY 7TH SEP][$250] Sign In - User navigated to deeplink conversation instead LHN when Signed out and back in Sep 2, 2024
@jliexpensify
Copy link
Contributor

Payment Summary

Upwork job

@bernhardoj
Copy link
Contributor

deployed to prod on 31st Aug, right?

Correct.

@DylanDylann
Copy link
Contributor

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

[@DylanDylann] The PR that introduced the bug has been identified. Link to the PR: NA
[@DylanDylann] 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: NA
[@DylanDylann] A discussion in #expensify-bugs 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: NA
[@DylanDylann] Determine if we should create a regression test for this bug. Yes
[@DylanDylann] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.

Regression Test Proposal

  1. Log out
  2. Open staging.new.expensify.com/settings
  3. Login
  4. Verify you are navigated to the settings page
  5. Log out
  6. Login again
  7. Verify you stay at LHN/Home

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot removed the Overdue label Sep 3, 2024
@jliexpensify jliexpensify added the Awaiting Payment Auto-added when associated PR is deployed to production label Sep 3, 2024
Copy link

melvin-bot bot commented Sep 6, 2024

@neil-marcellini, @jliexpensify, @bernhardoj, @DylanDylann 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 Sep 6, 2024
@jliexpensify
Copy link
Contributor

Paid and job closed.

@melvin-bot melvin-bot bot removed the Overdue label Sep 8, 2024
@bernhardoj
Copy link
Contributor

Requested in ND.

@JmillsExpensify
Copy link

$250 approved for @bernhardoj

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
No open projects
Status: No status
Development

No branches or pull requests

8 participants