You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running into a strange issue with my app where a specific (non-idempotent) URL is being loaded again after it's already been redirected away from. It results in weird issues where I get error messages about things that shouldn't have been loaded twice.
If it matters, I'm getting this when I try to log into my app using ASWebAuthenticationSession. After the successful login in the authentication session, I generate a signed token to log the user into the Hotwire Native app and redirect back to the app. This token expires after it's used once, and once it's used I redirect the user to their homepage. But for some reason after this redirect it is "restoring" the URL that contains the signed token to log in again, which causes errors. I can also make it redirect to the user's dashboard but then I get multiple visible pushes onto the navigation stack, and sometimes the bridge components break.
I see this in the Xcode logs on the second visit, which seems to imply that something is trying to restore the previous navigation entry, but I'm not sure why that would happen. That's why I'm trying to understand when these restoration visits happen ordinarily.
[Session] visit ["location": "...", "options":
HotwireNative.VisitOptions(action: HotwireNative.VisitAction.restore, response: nil), "reload": false]
Snapshotting a view (0x10881d800, WKWebView) that is not in a visible window requires afterScreenUpdates:YES.
[JavascriptVisit] startVisit ...
[Bridge] → window.turboNative.visitLocationWithOptionsAndRestorationIdentifier [Optional("..."), Optional({
action = restore;
}), Optional("...")]
One other potentially relevant factor: I have a path configuration rule to "replace_root" after I redirect the user to their dashboard after a successful login, but I also tried taking that out and it didn't help the situation.
I'm very perplexed about this and would appreciate any insight anyone can share. I realize it may be very niche and/or may not make any sense to anyone else, but I thought I'd try describing the situation without going into specifics of my app. Thanks!
Edit: It seems like this happens when someone navigates backwards. So maybe there is some connection to the replace_root path configuration but the same behavior occurred when I took it out so I'm confused...
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm running into a strange issue with my app where a specific (non-idempotent) URL is being loaded again after it's already been redirected away from. It results in weird issues where I get error messages about things that shouldn't have been loaded twice.
If it matters, I'm getting this when I try to log into my app using ASWebAuthenticationSession. After the successful login in the authentication session, I generate a signed token to log the user into the Hotwire Native app and redirect back to the app. This token expires after it's used once, and once it's used I redirect the user to their homepage. But for some reason after this redirect it is "restoring" the URL that contains the signed token to log in again, which causes errors. I can also make it redirect to the user's dashboard but then I get multiple visible pushes onto the navigation stack, and sometimes the bridge components break.
I see this in the Xcode logs on the second visit, which seems to imply that something is trying to restore the previous navigation entry, but I'm not sure why that would happen. That's why I'm trying to understand when these restoration visits happen ordinarily.
One other potentially relevant factor: I have a path configuration rule to "replace_root" after I redirect the user to their dashboard after a successful login, but I also tried taking that out and it didn't help the situation.
I'm very perplexed about this and would appreciate any insight anyone can share. I realize it may be very niche and/or may not make any sense to anyone else, but I thought I'd try describing the situation without going into specifics of my app. Thanks!
Edit: It seems like this happens when someone navigates backwards. So maybe there is some connection to the replace_root path configuration but the same behavior occurred when I took it out so I'm confused...
hotwire-native-ios/Source/Turbo/Session/Session.swift
Lines 274 to 288 in 3059c5f
Beta Was this translation helpful? Give feedback.
All reactions