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

Back Button Reopens All Previous Screens After Logging Out #129

Open
moisemomo opened this issue Mar 2, 2025 · 0 comments · May be fixed by #130
Open

Back Button Reopens All Previous Screens After Logging Out #129

moisemomo opened this issue Mar 2, 2025 · 0 comments · May be fixed by #130
Assignees
Labels
bug Something isn't working
Milestone

Comments

@moisemomo
Copy link

Describe the bug
After clicking on the logout button on the Logout screen, a confirmation dialog appears with Cancel and Confirm options. When Confirm is clicked and the user is redirected to the Auth screen, pressing the back button on the phone causes the Logout screen to open again, and continuing to press the back button opens all previous screens in the navigation stack, causing the user to navigate backward through all screens.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the Settings screen.
  2. Click on the Account Settings button.
  3. Click on the logout button.
  4. A confirmation dialog appears with Cancel and Confirm options.
  5. Click on Confirm to log out.
  6. You are redirected to the Auth screen.
  7. Press the back button on the phone.
  8. See the Settings screen reappear.
  9. Continuing to press the back button causes all previous screens to open, following the entire navigation stack backward.

Expected behavior
After confirming the logout, the user should be redirected to the Auth screen, and pressing the back button should not open any previous screens. The Logout screen and any other previous screens should be removed from the navigation stack, ensuring that the user cannot navigate back to them.

Screenshots

Tanga_backstack_bug.mp4

Smartphone :
Device: Pixel 8 Pro
OS: Android 15
Version: 1.3.4

Additional context
The issue occurs because the Logout screen is not removed from the navigation stack upon logout, causing it and all previous screens to be re-added when pressing the back button.

Possible fix:
Ensure the Logout screen and all preceding screens are removed from the stack when logging out by using popUpTo with the inclusive = true flag.

This will clear the back stack and prevent users from navigating backward into the previous screens.

@moisemomo moisemomo linked a pull request Mar 2, 2025 that will close this issue
1 task
@rygelouv rygelouv added the bug Something isn't working label Mar 3, 2025
@rygelouv rygelouv added this to the 1.3.5 milestone Mar 3, 2025
@rygelouv rygelouv linked a pull request Mar 3, 2025 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants