iOS doesn't load CSS sometimes when navigating between subdomains

I have just reported a related issue before being pointed to this, which seems to be related.

We just upgraded to Discourse 3.2 two days ago and since then we are getting reports of a similar issue. Although not CSS related in our case, I think the issue is essentially the same.

After following a link in Discourse to our main website, the browser still thinks it’s on the Forum: the URL in the browser says so (!), and sometimes (some? probably relative) links open in the forum domain instead, with an error saying the forum page doesn’t exist. The reports we have so far are all on iPhone/iPad. I can’t reproduce it at all, but those affected seem to experience it a few times a day. Looking at the Discourse logs, I can confirm that there are several 404 requests to pages that only exist on our main website.

I’m quite baffled at the browser opening one website and showing the URL of another (w/o iframes). Being a Safari bug, I sure hope this is only confined within a top domain, as the security implications otherwise are pretty nasty.

In any case, I think something to keep in mind is that this started happening only after we upgraded to Discourse 3.2, so something changed since 3.1 that is triggering this.

Perhaps a complete shot in the dark, but I wonder if this may be somehow related to PWA apps and how they are handled by Safari? Our main website declares a PWA app – and so does our Discourse forum. Both standalone and with start_url: "/" (ours sets a unique id, but Discourse doesn’t). AFAIK, PWA manifest files don’t specify a particular hostname they operate in, so I assume it sticks to the particular one they are hosted in. In our case, the two PWA’s are in separate subdomains but same domain; in how browsers process that there could have room for messing things up and getting the browser confused. But then again, this is just total guess.

2 Likes