App icon indicating copy to clipboard operation
App copied to clipboard

[$250] Clicking " Please sign in again" does nothing in "Session Expired" page

Open m-natarajan opened this issue 1 year ago β€’ 21 comments

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: 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
  • [x] 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: @NJ-2020

m-natarajan avatar Oct 28 '24 00:10 m-natarajan

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

MelvinBot avatar Oct 28 '24 00:10 MelvinBot

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.

melvin-bot[bot] avatar Oct 28 '24 00:10 melvin-bot[bot]

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: https://github.com/Expensify/App/blob/5103b4bd53ae74dcb301b8450f7046e82dc311d3/src/pages/LogInWithShortLivedAuthTokenPage.tsx#L29-L32 because it will remove the transition route from the history https://github.com/Expensify/App/blob/5103b4bd53ae74dcb301b8450f7046e82dc311d3/src/pages/ErrorPage/SessionExpiredPage.tsx#L35-L39 Because if we use navigate, the transition history still persists which keeps showing the session expired page https://github.com/Expensify/App/blob/5103b4bd53ae74dcb301b8450f7046e82dc311d3/src/libs/Navigation/AppNavigator/PublicScreens.tsx#L24-L33

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

https://github.com/user-attachments/assets/61b67386-3701-4735-9e3f-343adfe0d483

What alternative solutions did you explore? (Optional)

NJ-2020 avatar Oct 28 '24 01:10 NJ-2020

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

CortneyOfstad avatar Oct 28 '24 23:10 CortneyOfstad

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

melvin-bot[bot] avatar Oct 28 '24 23:10 melvin-bot[bot]

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

melvin-bot[bot] avatar Oct 28 '24 23:10 melvin-bot[bot]

@aimane-chnaif β€” can you attempt to recreate please πŸ™ Thank you!

CortneyOfstad avatar Oct 28 '24 23:10 CortneyOfstad

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

https://github.com/user-attachments/assets/eac21677-673b-46d7-8c12-cbaf3695f02c

cc: @CortneyOfstad @aimane-chnaif

NJ-2020 avatar Oct 29 '24 03:10 NJ-2020

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

farazahmad759 avatar Oct 29 '24 07:10 farazahmad759

πŸ“£ @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>

melvin-bot[bot] avatar Oct 29 '24 07:10 melvin-bot[bot]

Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/farazahmad759

farazahmad759 avatar Oct 29 '24 07:10 farazahmad759

βœ… Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] avatar Oct 29 '24 07:10 melvin-bot[bot]

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

aimane-chnaif avatar Oct 29 '24 21:10 aimane-chnaif

@NJ-2020's proposal looks good to me. πŸŽ€πŸ‘€πŸŽ€ C+ reviewed

aimane-chnaif avatar Oct 31 '24 20:10 aimane-chnaif

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

melvin-bot[bot] avatar Oct 31 '24 20:10 melvin-bot[bot]

@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()?

MariaHCD avatar Nov 01 '24 06:11 MariaHCD

πŸ“£ @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

melvin-bot[bot] avatar Nov 01 '24 06:11 melvin-bot[bot]

πŸ“£ @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 πŸ“–

melvin-bot[bot] avatar Nov 01 '24 06:11 melvin-bot[bot]

@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

NJ-2020 avatar Nov 01 '24 07:11 NJ-2020

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

MariaHCD avatar Nov 01 '24 09:11 MariaHCD

PR ready

cc: @aimane-chnaif

NJ-2020 avatar Nov 02 '24 05:11 NJ-2020

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

aimane-chnaif avatar Nov 04 '24 07:11 aimane-chnaif

Ohh, thank you @aimane-chnaif

NJ-2020 avatar Nov 04 '24 08:11 NJ-2020

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

melvin-bot[bot] avatar Nov 06 '24 00:11 melvin-bot[bot]

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

  • https://github.com/Expensify/App/pull/51852

If no regressions arise, payment will be issued on 2024-11-13. :confetti_ball:

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

melvin-bot[bot] avatar Nov 06 '24 00:11 melvin-bot[bot]

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

melvin-bot[bot] avatar Nov 06 '24 00:11 melvin-bot[bot]

BugZero Checklist:

  • [x] [Contributor] Classify the bug:
Bug classification

Source of bug:

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

Where bug was reported:

  • [x] 2a. Reported on production
  • [ ] 2b. Reported on staging (deploy blocker)
  • [ ] 2c. Reported on a PR
  • [ ] 2z. Other:

Who reported the bug:

  • [ ] 3a. Expensify user
  • [x] 3b. Expensify employee
  • [ ] 3c. Contributor
  • [ ] 3d. QA
  • [ ] 3z. Other:
  • [x] [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

  • [x] [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

  • [x] [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 πŸ‘Ž

aimane-chnaif avatar Nov 06 '24 00:11 aimane-chnaif

Thank you @aimane-chnaif!

CortneyOfstad avatar Nov 12 '24 21:11 CortneyOfstad

Payment Summary

@NJ-2020 β€” paid $250 via Upwork @aimane-chnaif β€” paid $250 via Upwork

Regression Test

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

CortneyOfstad avatar Nov 13 '24 21:11 CortneyOfstad