Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Conversation

@AndroidMedaGalaxy
Copy link
Member

Description

Back navigation popupstack fixed

Steps to reproduce

Testing with release 1.9.x

Positive QR Code scanned > consent aborted by refusing to submit keys > ending up on the home screen. >
Click "Andere Warnen" on the home screen > consented > shared keys > Submit keys without symptoms > come back on the screen by selecting yes in the popup > The app should close on Android's back key press. but it comes back to the thank you screen again.

This behaviour is the same for all the screens in Submission No consent Keys flow ( only till thank you screen)

Testing with this PR

Perform all the actions as above but when clicked back button on home screen, the App should close now instead of going back to the previous fragment.

Changes

nav_graph has been updated where app:popUpTo="@id/mainFragment" is replaced with app:popUpTo="@id/nav_graph"

Reason for this change

Somehow there could be multiple instances of mainfragment in the backstack. we're clearing the backstack completely to make a fresh start each time we navigate to mainfragment

@AndroidMedaGalaxy AndroidMedaGalaxy added the maintainers Tag pull requests created by maintainers label Dec 4, 2020
@AndroidMedaGalaxy AndroidMedaGalaxy added this to the 1.9.0 milestone Dec 4, 2020
@AndroidMedaGalaxy AndroidMedaGalaxy self-assigned this Dec 4, 2020
@AndroidMedaGalaxy AndroidMedaGalaxy requested a review from a team December 4, 2020 17:46
@AndroidMedaGalaxy AndroidMedaGalaxy changed the title Fix PopupTo Backstack issue Fix PopupTo Backstack issue (EXPOSUREAPP-4123) Dec 4, 2020
chiljamgossow
chiljamgossow previously approved these changes Dec 7, 2020
@d4rken d4rken self-requested a review December 7, 2020 18:55
@d4rken d4rken self-assigned this Dec 7, 2020
Copy link
Member

@d4rken d4rken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did not work for all screens.

  • Scan positive QR code
  • Give consent
  • Click "Finish" without symptom input
  • We end up on the home screen but on "back button" we still end up on the test result.

Same when ending the submission from SubmissionSymptomIntroductionFragment.

I've added the proposed solution with app:popUpTo="@id/nav_graph" to all navgraph actions leading from submission to the home fragment and it works for me now.

Please retest/review this @ritsam @chiljamgossow

@chiljamgossow
Copy link
Contributor

I cleaned up the graph. The app should only close after the mainFragment is shown. Many actions popUpTo mainFragment with popUpInclusive = true, so the mainFragment gets removed from the stack and any following popUpTo mainFragment has no effect.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 8, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@ralfgehrer ralfgehrer merged commit cae0cf2 into release/1.9.x Dec 8, 2020
@ralfgehrer ralfgehrer deleted the fix/4123-back-navigation branch December 8, 2020 13:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

maintainers Tag pull requests created by maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants