Repository navigation
fix: close open flows when a guard redirects the main stack - #101
Merged
Merged
Conversation
Contributor
|
📖 Docs preview: https://kaisel.dev/pr-101/ (updates on every push; removed when this PR closes) |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #101 +/- ##
=======================================
Coverage 99.66% 99.66%
=======================================
Files 43 43
Lines 2409 2418 +9
=======================================
+ Hits 2401 2410 +9
Misses 8 8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #90
When a main router guard rewrites a navigation and the main stack changes as a result,
KaiselRouternow closes every open modal flow, topmost first, and eachrunresolves withnull. Before, the flow stayed on top and hid the screen the guard sent the user to, so signing out mid flow left the flow over Login.When flows close
reevaluate/reevaluateOn(sign out, session expiry, app lock) and redirected pushes.When they stay open
Behaviour change. Marked as such in both changelogs. One consequence worth knowing: a lock guard that appends a passcode screen now closes an open flow too. That is the safer outcome, since before the flow covered the lock screen.
Tests
kaisel_core/test/kaisel_flow_redirect_test.dart: redirect viareevaluate, redirected push, nested flows, plus the three keep open cases. The three closing tests fail without the fix.kaisel/test/kaisel_flow_redirect_test.dart: widget test for the issue's case, sign out mid flow withreevaluateOn; Login shows and the flow UI is gone. Without the fix it hangs on the flow result.Docs. The guards guide and modal flows guide now describe the new behaviour and drop the
dismissFlowlistener workaround.