Only seem to happen on iOS devices - sometimes external links open to within the same window but CSS isn’t loading. Strange and I can’t even seem to reproduce!
Looks like this:
Also found reports on other public discourse forums:
Since it was reported and fixed before I wonder if it can be related to a theme or theme component maybe? Would appreciate any help.
no simply because I saw this behaviour a few times in the last two weeks, only on my iPhone and have heard the same from users but cannot reproduce, seems random.
this looks like an old bug. I can’t reproduce anywhere at the moment and all those linked topics are at least a year old. sounds like a forum that isn’t up to date.
It seems to be the same behaviour - it’s when opening an external website from within the discourse. For example, opening https://discourse.org/ from meta.discourse.org.
I thought so too, however it seems to only happen when clicking through from the forum and because I found other posts I thought maybe someone can shed a light on this - could be an iOS issue. Was easier if it was not loading CSS every time and just sometimes
@Lilly I wonder if you could share how discourse handles href and if there’s any particular way for iOS? This seems to be a Safari related issue, but it only ever happens from within discourse going out to another domain. That other domain isn’t being loaded as if discourse is trying to locally load the html of the requested page.
We’ve already tried forcing no-cache policy and playing around with www prefix. nothing seem to work. It’s exactly the issues mentioned here:
They had the main website load from their community.URL.com which caused the same partial page load.
For months now we’ve had iPhone users say that when clicking links from the sub domain (discourse) back to the main site, the page may not fetch CSS or JS but only HTML and therefore is unusable.
This does not happen every single time, but frequently enough so that they have to reload the page to fix it. By reloading they actually remain in discourse so they have to click again.
Looking at the access.log file of the nginx we can see that for some reason discourse tries to fetch the main domain files instead of index of the main domain.
Needless to say, discourse does not have these files and so the page is then broken.
This is from “access.log” of the nginx:
[19/May/2024:09:49:51 +0000] "here.domain.com" 176.76.227.47 "GET /js/cart/cart.js?v=0.32 HTTP/2.0" "Mozilla/5.0 (iPhone; CPU iPhone OS 17_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Ribblr Mobile" "-" 429 230 "https://here.domain.com/c/testing/17" - 0.000 "-" "-" "-" "-" "-" "-" "-"
[19/May/2024:09:49:51 +0000] "here.domain.com" 176.76.227.47 "GET /css/footer_and_header.css?v=1.13 HTTP/2.0" "Mozilla/5.0 (iPhone; CPU iPhone OS 17_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Ribblr Mobile" "-" 404 7963 "https://here.domain.com/c/testing/17" 0.019 0.019 "-" "-" "-" "-" "-" "-" "-"
[19/May/2024:09:49:51 +0000] "here.domain.com" 176.76.227.47 "GET /css/common/jssocials.css?v=0.03 HTTP/2.0" "Mozilla/5.0 (iPhone; CPU iPhone OS 17_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Ribblr Mobile" "-" 404 7968 "https://here.domain.com/c/testing/17" 0.020 0.020 "-" "-" "-" "-" "-" "-" "-"
[19/May/2024:09:49:51 +0000] "here.domain.com" 176.76.227.47 "GET /js/common/lightslider.js?v=0.14 HTTP/2.0" "Mozilla/5.0 (iPhone; CPU iPhone OS 17_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Ribblr Mobile" "-" 404 7980 "https://here.domain.com/c/testing/17" 0.020 0.020 "-" "-" "-" "-" "-" "-" "-"
[19/May/2024:09:49:51 +0000] "here.domain.com" 176.76.227.47 "GET /js/common/jssocials.js HTTP/2.0" "Mozilla/5.0 (iPhone; CPU iPhone OS 17_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Ribblr Mobile" "-" 404 7978 "https://here.domain.com/c/testing/17" 0.034 0.034 "-" "-" "-" "-" "-" "-" "-"
We tried using both href links and window.reload() but the issue remains the same. Once again, it only happens occasionally and only for iPhone users.
Any ideas why this happens and how it can be fixed?
Wondering if some team members have any thoughts? @Lilly I know we’ve discussed here a couple months ago - maybe you have additional insights to share?
I think it’s the same issue as the discourse website I shared on my first post.
We have observed some strange issues like this. As far as we can tell, it must be a bug in Safari/WebKit. It should be impossible for this kind of ‘mixed site’ rendering to happen. We have filed a report with WebKit. (cc @pmusaraj)
If anyone can find a consistent way to reproduce the issue, that would almost certainly help to get the bug prioritised.
Any ideas for an external link workaround?
Both HTML HREF and JS window.replace behave the same
(I’m sure the Fwd/Back are almost impossible to override)
Sadly, I don’t have any ideas for a workaround. I tried deregistering service workers in case that was the conflicting reason, but it had no effect.
Currently I have switched to Safari Technology Preview locally. It seems to not have the issue, which may be an indicator that this is fixed in newer versions of Webkit. Or, it means that a fresh browser with a fresh cache doesn’t have the issues… hard to say.
We will monitor this and keep looking for fixes, the issues affects multiple people in the Discourse team and on different platforms (macOS, iOS, DiscourseHub app). Short of finding a magic fix, though, the best we can do here is follow the Webkit bug report and add additional information there, if relevant/useful.