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 2024-11-13] [$250] Clicking " Please sign in again" does nothing in "Session Expired" page #51546

Closed
1 of 8 tasks
m-natarajan opened this issue Oct 28, 2024 · 29 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 Needs Reproduction Reproducible steps needed

Comments

@m-natarajan
Copy link

m-natarajan commented Oct 28, 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:
Reproducible in staging?: needs reproduction
Reproducible in production?: needs reproduction
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
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: @carlosmiceli
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1729880182560339

Action Performed:

  1. Have a " Your Session has Expired" screen
  2. Click on "Please sign in again"

Expected Result:

User is taken to sign in screen

Actual Result:

Nothing happens

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

Screenshot 2024-10-25 at 3 14 04 PM

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021851043610237148822
  • Upwork Job ID: 1851043610237148822
  • Last Price Increase: 2024-10-28
  • Automatic offers:
    • aimane-chnaif | Reviewer | 104689909
    • NJ-2020 | Contributor | 104689912
Issue OwnerCurrent Issue Owner: @CortneyOfstad
@m-natarajan m-natarajan added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels Oct 28, 2024
@MelvinBot
Copy link

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

Copy link

melvin-bot bot commented Oct 28, 2024

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.

@NJ-2020
Copy link
Contributor

NJ-2020 commented Oct 28, 2024

Proposal

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

Clicking " Please sign in again" does nothing in "Session Expired" page

What is the root cause of that problem?

We should use goBack() function instead of navigate(), same like what we do here:

Navigation.isNavigationReady().then(() => {
// We must call goBack() to remove the /transition route from history
Navigation.goBack();
Navigation.navigate(ROUTES.HOME);

because it will remove the transition route from the history
if (!NativeModules.HybridAppModule) {
Session.clearSignInData();
Navigation.navigate();
return;
}

Because if we use navigate, the transition history still persists which keeps showing the session expired page
<RootStack.Screen
name={NAVIGATORS.BOTTOM_TAB_NAVIGATOR}
options={defaultScreenOptions}
component={NativeModules.HybridAppModule ? SessionExpiredPage : SignInPage}
/>
<RootStack.Screen
name={SCREENS.TRANSITION_BETWEEN_APPS}
options={defaultScreenOptions}
component={LogInWithShortLivedAuthTokenPage}
/>

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

We should use goBack instead of navigate

onPress={() => {
    if (!NativeModules.HybridAppModule) {
        Session.clearSignInData();
        Navigation.goBack();
        return;
    }
    NativeModules.HybridAppModule.closeReactNativeApp(true, false);
}}

OR

onPress={() => {
    if (!NativeModules.HybridAppModule) {
        Session.clearSignInData();
        Navigation.isNavigationReady().then(() => {
            Navigation.goBack();

            // OPTIONAL: Navigation.navigate(ROUTES.SIGN_IN_MODAL);
        });
        return;
    }
    NativeModules.HybridAppModule.closeReactNativeApp(true, false);
}}

Result

Screen.Recording.2024-10-27.at.18.29.28.mov

What alternative solutions did you explore? (Optional)

@CortneyOfstad CortneyOfstad added retest-weekly Apply this label if you want this issue tested on a Weekly basis by Applause and removed retest-weekly Apply this label if you want this issue tested on a Weekly basis by Applause labels Oct 28, 2024
@CortneyOfstad
Copy link
Contributor

I am not able to recreate, so going to see if the C+ can recreate based on the SO linked above

@CortneyOfstad CortneyOfstad added the External Added to denote the issue can be worked on by a contributor label Oct 28, 2024
Copy link

melvin-bot bot commented Oct 28, 2024

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

@melvin-bot melvin-bot bot changed the title Clicking " Please sign in again" does nothing in "Session Expired" page [$250] Clicking " Please sign in again" does nothing in "Session Expired" page Oct 28, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 28, 2024
Copy link

melvin-bot bot commented Oct 28, 2024

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

@CortneyOfstad
Copy link
Contributor

@aimane-chnaif — can you attempt to recreate please 🙏 Thank you!

@NJ-2020
Copy link
Contributor

NJ-2020 commented Oct 29, 2024

I can still consistently reproduce this issue

  1. Sign in with new account on OD
  2. Click support > concierge
  3. Copy the transition link and close the tab
  4. Logout on ND
  5. Wait for 1 or 2 minute to wait until the auth token expired
  6. Paste the transition link on ND
Screen.Recording.2024-10-28.at.20.19.42.mov

cc: @CortneyOfstad @aimane-chnaif

@farazahmad759
Copy link

Proposal

The Navigation.navigate() method should be invoked within the callback of isNavigationReady() as shown below:

Navigation.isNavigationReady().then(() => {
    Navigation.navigate();
});

This ensures that navigation only occurs once the navigation container is fully prepared and ready to handle navigation actions.

Reference: https://github.com/Expensify/App/blob/db592c9c9f56a6ce8208b898c1e5ba1eb864aae8/src/pages/ErrorPage/SessionExpiredPage.tsx#L35C1-L39C34

Copy link

melvin-bot bot commented Oct 29, 2024

📣 @farazahmad759! 📣
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>

@farazahmad759
Copy link

Contributor details
Your Expensify account email: farazahmad759@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/farazahmad759

Copy link

melvin-bot bot commented Oct 29, 2024

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

@aimane-chnaif
Copy link
Contributor

aimane-chnaif commented Oct 29, 2024

@farazahmad759 please follow proposal template as stated in contributing guideline.

@aimane-chnaif
Copy link
Contributor

@NJ-2020's proposal looks good to me.
🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Oct 31, 2024

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

@MariaHCD
Copy link
Contributor

MariaHCD commented Nov 1, 2024

@NJ-2020's proposal makes sense to me.

I see that Navigation.navigate(ROUTES.SIGN_IN_MODAL); is optional - why should we or shouldn't we use this in additional to goBack()?

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

melvin-bot bot commented Nov 1, 2024

📣 @aimane-chnaif 🎉 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

Copy link

melvin-bot bot commented Nov 1, 2024

📣 @NJ-2020 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@NJ-2020
Copy link
Contributor

NJ-2020 commented Nov 1, 2024

@MariaHCD

I see that Navigation.navigate(ROUTES.SIGN_IN_MODAL); is optional - why should we

To make sure we get redirected to the correct page in case if we have another page before session expired page

or shouldn't we use this in additional to goBack()?

Calling goBack() only still works fine and if we pass the route sign in modal as a fallback route to the goBack will push new full stack navigator

@MariaHCD
Copy link
Contributor

MariaHCD commented Nov 1, 2024

I like the idea of explicitly calling Navigation.navigate(ROUTES.SIGN_IN_MODAL); since it's more obvious that we are redirecting to the sign in page.

But we can iron this out in the PR.

cc: @aimane-chnaif

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Nov 2, 2024
@NJ-2020
Copy link
Contributor

NJ-2020 commented Nov 2, 2024

PR ready

cc: @aimane-chnaif

@aimane-chnaif
Copy link
Contributor

I like the idea of explicitly calling Navigation.navigate(ROUTES.SIGN_IN_MODAL); since it's more obvious that we are redirecting to the sign in page.

This doesn't work. Still does nothing showing this error:

image

@NJ-2020
Copy link
Contributor

NJ-2020 commented Nov 4, 2024

Ohh, thank you @aimane-chnaif

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Nov 6, 2024
@melvin-bot melvin-bot bot changed the title [$250] Clicking " Please sign in again" does nothing in "Session Expired" page [HOLD for payment 2024-11-13] [$250] Clicking " Please sign in again" does nothing in "Session Expired" page Nov 6, 2024
Copy link

melvin-bot bot commented Nov 6, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 6, 2024
Copy link

melvin-bot bot commented Nov 6, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.57-10 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 2024-11-13. 🎊

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

Copy link

melvin-bot bot commented Nov 6, 2024

@aimane-chnaif @CortneyOfstad 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]

@aimane-chnaif
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
  • 2b. Reported on staging (deploy blocker)
  • 2c. 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/48007/files#r1830232657

  • [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 Template
  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Precondition:

N/A

Test:

  1. Sign in on OD
  2. Click support > Concierge
  3. Copy the transition link and close the tab
  4. Logout on ND
  5. Wait for 1 or 2 minute to wait until the auth token expired
  6. Paste the transition link on ND
  7. Click the "Please sign in again".
  8. Verify that it got redirected to the sign in page

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Nov 12, 2024
@CortneyOfstad
Copy link
Contributor

Thank you @aimane-chnaif!

@CortneyOfstad
Copy link
Contributor

Payment Summary

@NJ-2020 — paid $250 via Upwork
@aimane-chnaif — paid $250 via Upwork

Regression Test

https://github.com/Expensify/Expensify/issues/443985

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 Needs Reproduction Reproducible steps needed
Projects
None yet
Development

No branches or pull requests

7 participants