[$250] Clicking " Please sign in again" does nothing in "Session Expired" page
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:
- Have a " Your Session has Expired" screen
- 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
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 Owner
Current Issue Owner: @NJ-2020
This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989
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.
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)
I am not able to recreate, so going to see if the C+ can recreate based on the SO linked above
Job added to Upwork: https://www.upwork.com/jobs/~021851043610237148822
Triggered auto assignment to Contributor-plus team member for initial proposal review - @aimane-chnaif (External)
@aimane-chnaif β can you attempt to recreate please π Thank you!
I can still consistently reproduce this issue
- Sign in with new account on OD
- Click support > concierge
- Copy the transition link and close the tab
- Logout on ND
- Wait for 1 or 2 minute to wait until the auth token expired
- Paste the transition link on ND
https://github.com/user-attachments/assets/eac21677-673b-46d7-8c12-cbaf3695f02c
cc: @CortneyOfstad @aimane-chnaif
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! π£ 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:
- Make sure you've read and understood the contributing guidelines.
- 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.
- 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.
- Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/farazahmad759
β Contributor details stored successfully. Thank you for contributing to Expensify!
@farazahmad759 please follow proposal template as stated in contributing guideline.
@NJ-2020's proposal looks good to me. πππ C+ reviewed
Triggered auto assignment to @MariaHCD, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
@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()?
π£ @aimane-chnaif π An offer has been automatically sent to your Upwork account for the Reviewer role π Thanks for contributing to the Expensify app!
π£ @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 π
@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
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
PR ready
cc: @aimane-chnaif
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:
Ohh, thank you @aimane-chnaif
Reviewing label has been removed, please complete the "BugZero Checklist".
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:
- @NJ-2020 requires payment automatic offer (Contributor)
- @aimane-chnaif requires payment automatic offer (Reviewer)
@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]
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.
-
[ ] [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:
- Sign in on OD
- Click support > Concierge
- Copy the transition link and close the tab
- Logout on ND
- Wait for 1 or 2 minute to wait until the auth token expired
- Paste the transition link on ND
- Click the "Please sign in again".
- Verify that it got redirected to the sign in page
Do we agree π or π
Thank you @aimane-chnaif!
Payment Summary
@NJ-2020 β paid $250 via Upwork @aimane-chnaif β paid $250 via Upwork
Regression Test
https://github.com/Expensify/Expensify/issues/443985