Benjamin Sawyer
Benjamin Sawyer

Reputation: 1

Seeing an increase API timeout errors on abandoned jQuery ajax calls in Safari after iOS 18 update

Reported Issue:

Data from Metrics:

Research:

We tried modifying the ajax call with async: true but still saw the same API timeout error in metrics monitoring.

We cannot use abort as the call is to a different domain than our website.

I found only a few other questions on stackoverflow specific to how Safari handles an abandoned ajax call with no response. The typical quick fix did not work and the issue has exploded since the release of iOS 18 specifically so I feel this warrants a dedicated question.

Upvotes: 0

Views: 633

Answers (2)

Yngve B-Nilsen
Yngve B-Nilsen

Reputation: 9676

We had an increase in customer reports about this just before Christmas, and it was quite hard to pinpoint the problem. There seems to be a change in how memory and resources are allocated in iOS 18, without knowing the specifics, that causes resource intensive webpages to crash. The same happens on googles deepmind landing page for instance.

Our solution was a combination of multiple steps. Among other things, we had scroll-listeners that did stuff, causing repaints and reflows, which we refactored to use IntersectionObserver instead. Stuff like getBoundingClientRect() will also trigger repaints, and cause the memory and CPU to spike if triggered repeatedly.

Also, if you use stuff like clarity or HotJar to make recordings of your users interactions, this will further eat resources on the client. I suspect all, or some of these issues causes the webpage to take up just enough resources for iOS to say “stop”, and it attempts to reload the page, only to see a similar spike in resources again, effectively shutting the tab down.

We successfully confirmed that this was not an issue in previous iOS versions, and even tested on and iPhone 6 with iOS 15. The make and model of iPhone/iPad does not matter, and neither does the browser used.

I recommend using the dev tools in your browser to see if you can pinpoint spikes in CPU/GPU usage when interacting with your web app. Use this as a baseline to improve the overall performance and I think you’ll get this fixed :)

Hope this helps you get closer to figure out what causes the error in your application!

Upvotes: 0

Alejandro
Alejandro

Reputation: 1

Apple has released a new version iOS 18.0.1. It fix the problem

Upvotes: 0

Related Questions