Fixed back stack navigation issue in Add Authenticator's SDK#27
Merged
Conversation
| /// In embedded mode, only removes entries added since `useExternalPath(_:)` was | ||
| /// called, leaving the host-app entries intact so the host stack is undisturbed. | ||
| func popToSDKRoot() { | ||
| if let ext = externalPath { |
Contributor
There was a problem hiding this comment.
@Sudhanshu96 useExternalPath sets internalExternalPathCount same as externalPath.wrapperValue.count. When does internalExternalPathCount become less than externalPath.wrapperValue.count?
Contributor
Author
There was a problem hiding this comment.
When the host app already has NavigationStack then initialExternalPathCount marks the boundary — so popToSDKRoot() knows to only remove the SDK's routes without disturbing the host app's navigation.
This piece of code:
let toRemove = ext.wrappedValue.count - initialExternalPathCount
guard toRemove > 0 else { return }
caters to the case or rather protects against calling popToSDKRoot() when already at SDK root (no SDK routes pushed) otherwise the hoes app's navigation would get affected thus providing a bad user expereince.
NandanPrabhu
approved these changes
May 25, 2026
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.
📋 Changes
Fixed back stack navigation issue in Add Authenticator's SDK
📹 Video
back_navigation_issue_resolved.mov