-
-
Notifications
You must be signed in to change notification settings - Fork 115
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 is broken in iOS since 1.5.0 #574
Comments
Thanks for bringing this to my attention. I'll take a look when I can get my hands on an iOS device. Any idea what might be going on? |
Unfortunately no :/ But after further testing it does seem like the back button always brings you back to the home page for some reason.
Same issue in the iOS simulator if you have access to an OSX machine. |
If there's anything I can help you test just let me know and I'll do my best! |
I've got an old iPod touchy for testing, but I gotta get a charger for it lol. Appreciate the leads. |
Lol OK :) I guess in the meantime I'll roll back a version.
…On Jan 26, 2018 10:58, "Matthew James Davis" ***@***.***> wrote:
I've got an old iPod touchy for testing, but I gotta get a charger for it
lol. Appreciate the leads.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#574 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AA-uxHzMFKnTH3IGSF3CEqw4urM18JPNks5tOaGvgaJpZM4RtK0B>
.
|
Can confirm it's definitely a problem with |
Could it have something to do with routes not being added to browser history? I don't think anything I've added has caused this (but yeah, if I had a nickel for every time...) but I have to admit I haven't tested my PRs on iOS on account of not having it available. 😊 |
(That blush looked way too happy. It's supposed to be a sad and embarassed blush, guys.) |
I have the exact same issue with Safari on Mac and downgrading to |
I also encountered this problem on macOS Safari. You don't need an iOS device to debug. |
Possibly a related issue? I ran into both at the same time. Can anyone determine if downgrading the router to v1.4 fixes issue 528 as well? |
@jimwards17 #528 was reported before 1.5.0 released afaik. |
So... not to be that guy, but is anyone working on this? It's a pretty huge bug that's currently live and out there in the latest release of |
All right so I got my touchy charged up and create a test repo: http://davismj.me/test-router/ I navigate Welcome > Github Users > Child Router. I click the back button. I'm at Github Users. This is the expected behavior. I'll need a repro to move forward, @powerbuoy . |
@davismj Cheers :) My guess is it doesn't affect hashChange apps because your example works in Safari for me. Here's a newly created Aurelia CLI app that exhibits the bug though. And here's a video: https://youtu.be/p-BHoAm6qNo and a live demo: http://route-test.lagerkvist.eu/ |
|
Got it, so it is a push state issue. I'll take another look. @huochunpeng no access to a mac sadly I personally never use pushState in apps. Is it that popular of an option? |
@davismj, to be honest, you might be the only one left using hash instead of push. :-) |
@huochunpeng are there any errors logged to the console in safari? that would be a huge help to me |
@davismj I will check tomorrow once I got to office. |
This bug does occur when using hash change. I heard mention on github of a feature that would prevent the back navigation from browsing to a previous site (different host). Did that get implemented in 1.5? @davismj - I was going to take a look at the router code but I couldn't figure out why there are type definitions in the .js files. VS Code shows syntax errors all over! Is there an extension to make this work? Is there a document on the IDE setup for contributing to Aurelia? I couldn't find anything. |
@davismj zero error in Safari console for me too. Even with developmentLogging turned on, no extra debug/log/warn/error. |
Appreciate the feedback guys. I'll do what I can. @mattgaspar Thanks for the insight, both on the bug and on contributing. I use sublime text and so I've never seen errors and never thought twice about it. I'll take another look and maybe look at adding documentation about contributing. In the mean time, check out the flow types plugin for vs code. The typings exist for the generation for .dts files. They are technically TypeScript typings but when we build the JavaScript we use Babel and the flow plugin. |
Bit more information, the additional field Which means the value your get from history state after |
Based on what I read from https://www.w3.org/TR/html50/browsers.html#history
Both Although the standard does not explicitly reject you from touching the cloned object, but to me it's common sense that the standard tries to protect the state object as immutable.
@jwx I should read your implementation before I say something stupid out of imagination. (The first half was not wrong but irrelevant). |
@huochunpeng Thanks for this, great info and saved me a lot of headache since I don't have a Safari machine. I think My guess is that the problem is here. I think maybe Safari doesn't like not having a title in the I'm reaching out to you on Gitter now. For additional info. |
I'm the one that added the use of the state object and as far as I interpreted https://www.w3.org/TR/html50/browsers.html#state-object it's intended to support the kind of usage implemented. There might be something wrong with the implementation, though (especially since https://caniuse.com/#search=replaceState says it shold be okay to use), and @davismj might have found the culprit. I might be able to take a look at this during the weekend, but I don't have iOS around so if someone could then help out with testing that'd be great. |
@huochunpeng and I are working on it. I'll keep everyone posted here. |
@davismj @huochunpeng Might be that url is null, possibly similar to this: https://stackoverflow.com/questions/47145052/ios-11-1-securityerror-dom-exception-18-blocked-attempt-to-use-history-replac |
Unlikely, the third parameter is optional. |
I think we're already in the realm of Unlikely since such a fairly simple thing is not working. But technically, the third parameter isn't left out; it's set to |
There is currently a bug in Safari that doesn't properly handle the optional third parameter to the replaceState(state, title, url) function when a <base /> tag is present on the page. This fix explicitly sets the url property to the location.href value. Thanks to @powerbuoy @huochunpeng and @jwx for helping diagnose this issue! Closes #34 aurelia/router#574
@huochunpeng #574 (comment) Seems like Safari isn't strictly following the standard after all. Thanks again for debugging and finding the fix. |
:-) |
Awesome work guys! |
Any ETA on a 1.5.1 release with this fix? :) The biggest use-case for me with |
@davismj Let me know when you're ready for me to do a new release. |
I can confirm that the PR fixes my issues, with navigating back on Safari in macOS, as well. Looking forward to this being merged and released! |
@EisenbergEffect can be pulled in, see PR comments |
Any chance we'll see a release this week? |
Yes. @davismj Can you go ahead and merge this? After that, just give me the all clear for a release and it will go out this weekend. |
@EisenbergEffect, @davismj already merged the PR :) |
LOL That's what I get for being in a rush and not reading everything carefully! We'll get it out this weekend. |
this is still not working as expected on safari mobile |
@jimwards17 care to elaborate? |
I thought this was a router issue but it looks like @davismj updated the hsitory browser package. I'm not really sure where it makes the most sense to post this isssue, but i'm running latest for all packages and im still seeing this issue. Also on any device including desktop the confirm prompt is presented but if you select cancel and then click the back button again and then select ok in the confirm prompt you are brought two history locations back. This might be two separate issues but the browser history not being maintained is pretty big... |
@jimwards17 that is a known issue: #528 |
Since the latest update that introduced the very useful
isNavigating*
flags the back button is broken in iOS and seems to always take the user back to the home page.To reproduce simply set up an Aurelia CLI app with at least 3 routes, then navigate from home, to route 2 to route 3 then hit the back button and you'll end up on home - not route 2.
The text was updated successfully, but these errors were encountered: