-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[Payment May 22] [$250] Dev: Sign out option is shown and signout API is called in the crash error message screen even when the user is not signed in. #61336
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
Comments
Triggered auto assignment to @abekkala ( |
This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989 |
Proposal by @allgandalf ProposalPlease re-state the problem that we are trying to solve in this issue.Signout option is shown on the generic error page even when the user is not signed in. What is the root cause of that problem?We shown the sign out option regardless of checking whether the user is signed in or not: App/src/pages/ErrorPage/GenericErrorPage.tsx Lines 66 to 72 in 223a34c
This causes us to always show the button. What changes do you think we should make in order to solve the problem?We need to check if the session has authToken then only display the button: const isSignedIn = !!session?.authToken && session?.authTokenType !== CONST.AUTH_TOKEN_TYPES.ANONYMOUS;
{isSignedIn && (
<Button
text={translate('initialSettingsPage.signOut')}
onPress={() => {
Session.signOutAndRedirectToSignIn();
refreshPage();
}}
/>
)} What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?N/A, but if we need we can render the screen and check the button is not visible if the user is not logged in What alternative solutions did you explore? (Optional)N/A |
I don't think this requires Needs Repro label. |
@abekkala Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
Job added to Upwork: https://www.upwork.com/jobs/~021920085359499306735 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @allgandalf ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Sign out option is shown and signout API is called in the crash error message screen even when the user is not signed in. What is the root cause of that problem?We shown the sign out option regardless of checking whether the user is signed in or not: App/src/pages/ErrorPage/GenericErrorPage.tsx Lines 66 to 72 in 223a34c
This causes us to always show the button. What changes do you think we should make in order to solve the problem?We need to check if the session is authenticated then only display the button: const isAuthenticated = useIsAuthenticated();
{isAuthenticated && (
<Button
text={translate('initialSettingsPage.signOut')}
onPress={() => {
Session.signOutAndRedirectToSignIn();
refreshPage();
}}
/>
)} 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)N/A |
Let's go with @shubham1206agra 's proposal here ^ 🎀👀🎀 C+ reviewed |
Triggered auto assignment to @chiragsalian, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
Proposal LGTM, feel free to create the PR @shubham1206agra |
📣 @allgandalf 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
Merged to prod yesterday |
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 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: @allgandalf
Slack conversation (hyperlinked to channel name): #Expensify Bugs
Action Performed:
Precondition: The user is signed out
The app needs to crash when you're on the sign-in page ( due to onyx null / empty string values)
Expected Result:
There should be no sign out button as the user is not logged in.
Actual Result:
There is a sign out button and the API to signout gets called everytime we click sign out.
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
Platforms Tested:
On which of our officially supported platforms was this issue tested:Screenshots/Videos
Add any screenshot/video evidence
Screen.Recording.2025-05-02.at.11.06.59.AM.mov
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @chiragsalianThe text was updated successfully, but these errors were encountered: