-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
bug: ios, unexpected reloads with safari and z-index #25760
Comments
I can confirm this issue in one of our apps, too. This is probably related to webkit, where they fixed some flickering issue when using overlapping z-index layers. https://webkit.org/blog/13009/new-webkit-features-in-safari-15-6/ When i remove elements which got position absolute and higher z-index, webview won't crash.
|
Thanks for the issue. I tested this on an iPhone 11 running iOS 15.6 and was unable to reproduce the issue. Here are the steps I followed.
Did I miss anything? repro-video.mp4 |
I changed the max number of items from 60 to 200 and now I can reproduce the issue. Let me take a closer look. |
When transitioning to a new page, the webview memory spikes to over 1GB which is likely why the webview is restarting. |
This does appear to be a bug in WebKit. I file an issue with the team here: https://bugs.webkit.org/show_bug.cgi?id=243949 |
Sadly this seems to be an issue in iOS 16 as well. :( |
@selected-pixel-jameson it is and for us it is very critical. Maybe it helps if you comment in bugzilla as well so apple priorizes this up |
@EinfachHans Same here. I'm checking iOS 15.7 right now, but I'm assuming the same issue will persist since the bug report has not been addressed. |
Still an issue with 15.7 as well. |
Hi everyone, I have an update on this WebKit issue: Why is this issue happening? There was a bug fixed in iOS 15.6 related to negative z-index values. This fix had an unintended side effect where elements with negative z-index values trigger backing store (an optimization in WebKit) when animating. This can help improve application performance at the expense of memory. When too many elements trigger this optimization, the web process gets killed for using too much memory.
At the moment this issue impacts iOS 15.6, 15.7, and 16.0. How can I work around the issue in my app? There are a few options here:
ion-item::part(native)::after {
content: none;
}
ion-item::part(native)::after {
z-index: 0;
pointer-events: none;
} Note: The
Virtual Scrolling with Ionic Angular: https://ionicframework.com/docs/angular/virtual-scroll When will this issue be fixed? Since this is a bug in WebKit, we are unable to comment on when this issue will be resolved. However, we are in contact with the WebKit team and are trying to get this fix prioritized. I will post any additional updates on this thread. Thanks! |
@liamdebeasi Thank you! We will try this out immediately! |
@liamdebeasi Thanks a lot for diving in and the summary! 👍🏼 Just tested by removing the |
@liamdebeasi This also seems to fix the issue for us in preliminary testing. Unfortunately the content within our ion-item's is dynamic so we are unable to use virtual scrolling due to it's requirement of a consistent heights. |
|
@liamdebeasi works 👍🏼 |
I merged #25942 which will avoid this bug with |
This comment was marked as off-topic.
This comment was marked as off-topic.
We will post any updates as we have them. If there has not been a new post, then there are no new updates. I also recommend following https://bugs.webkit.org/show_bug.cgi?id=244543. The WebKit team thinks that the fix for this will resolve the issue reported here. |
The related WebKit issue has been fixed. I will test this in an upcoming Safari pre-release to see if this fixes the issue reported here. |
@liamdebeasi Hey, would you be able to confirm if my app is crashing because of this issue? I can add you to the repository which contains the whole project that is failing since iOS 16. |
Unfortunately, we don't provide free support/debugging. However, you can check using Safari Developer Tools. In the (Note "Memory: 37.40 MB" in the bottom right) Perform the steps that crash your app. If you see the "Memory" usage spike significantly, then it is possible that you are running into this WebKit issue. In this case, you should be looking for memory spikes of 100s of megabytes (such as jumping from 50MB to 1GB). In other words, you are looking for a jump in memory significant enough for the web process to be killed by the operating system. |
I had this issue and I spent a couple of days trying to figure it out. The problem was this - I was using |
My issue was related to AnimationController from @ionic/angular. My app has a background animation that consists of 4 shapes that are sliding back and forth with the transform property. After disabling this animation the crashes stopped. |
@liamdebeasi the testcase you provided at the webkit issue still seems to crash for me with iOS |
The WebKit fix has not shipped in iOS yet, so this issue will continue to reproduce. |
Observing similar behaviour in Cordova I cut out some components of index.html and got the stuck app to run again. |
This is happening still, it is completely blocking the release of my app. One page of 4 similar/identical pages is crashing with this error. Making Ionic unusable at this point...... I do not use ion-item or ion-card, just a lot of ion-grids and ion-slider. The pages that do work are constructed the exact same way, really annoying bug. It is also intermittent, it works sometimes, crashes others, usually works on the second reload after crashing on first visit This is the payload that is crashing....stupid. It was 10mb, thought maybe that was the problem, reduced it all the way down to this and iOS or ionic cant handle it
|
@ucjallen Since this is a WebKit bug, I recommend posting on https://bugs.webkit.org/show_bug.cgi?id=243949 explaining that this is blocking your application launch. However, I also noticed that your error code ( |
The problem with the So, I think is important to have a forum or a specific page on the Ionic documentation with the News and Advices about WebKit issues, so we can discuss with the community those scenarios and possibles workarounds. since we cannot change the Safari idiosyncrasy. It will help a lot! |
I also have a similar issue in cordova when switching to a different window. |
I've been really looking for a solution to this sudden problem for a long time. I can identify 2 main fixes: 1. Do not use a negative z-index (this leads to a very significant memory leak)
This will prevent an overabundance of memory and a possible restart of the application during transitions. In principle, the use of 2 of these items was enough for me. But it still uses a large memory leak, because of this error. Since most of the standard ionic components are subject to this problem! |
Hi everyone, Does this issue reproduce for you all on iOS 16.3? I can no longer reproduce the issue on my end. |
Unfortunately, I can't check on ios 16.3 right now. I hope this problem will be fixed! |
It looks like the problem still remains on ios 16.3 |
@Ivan981508 are you sure this is the same problem? Because i can't reproduce this either @liamdebeasi |
I had this problem and got it to resolve completely by eliminated any css with:
I saw a big spike in Wkwebview memory usage when a page I was loading that contained icons that all had a drop-shadows. When that memory peaked the App flickered, went black and crashed. Problem went away immediately by eliminating all my drop-shadow css. Hope this helps someone with a similar issue |
Hi everyone, I am no longer able to reproduce the reported issue in iOS 16.3. I am going to close this since iOS 16.3 is now available. If you are still running into crashes, you are likely encountering a separate issue. I recommend opening a new issue with a minimal reproduction app. Let me know if there are any questions. Thanks! |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Prerequisites
Ionic Framework Version
Current Behavior
First: This may be a Webkit Bug, but i'm not 100% sure. Also i never reported a issue to them before and i know you guys did and know what they need to handle an issue faster.
In our app we have a lot of crash Reports, which are related to the internal Webview beeing reloaded after a crash. I already looked on this topic together with Sean, who gave me a lot of performance refactoring points, which doesn't resolved the issue. We were not able to determinate this 100%. But know i was able to create a reproducable repo.
I'm not sure what is causing this, but it is definitive relevant to the amount of items on the page. When clicking on the first item: Everything works fine. If you scroll down and click on the 60th item: CRASH
This is shown in the xcode console:
Expected Behavior
The webview should not crash 😃 If this is a webkit bug, it would be awesome if you could create the issue there and link it here.
Steps to Reproduce
If you scroll down until all items are shown, than scroll up again and click on the first item it also crashes so is related to amount of items on that page
Code Reproduction URL
https://github.com/EinfachHans/ionic-webkit-crash
Ionic Info
Ionic:
Ionic CLI : 6.20.1 (/Users/hans/.nvm/versions/node/v16.14.2/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 6.2.2
@angular-devkit/build-angular : 14.1.2
@angular-devkit/schematics : 14.1.2
@angular/cli : 14.1.2
@ionic/angular-toolkit : 6.1.0
Capacitor:
Capacitor CLI : 4.0.1
@capacitor/android : not installed
@capacitor/core : 4.0.1
@capacitor/ios : 4.0.1
Utility:
cordova-res (update available: 0.15.4) : 0.15.1
native-run : 1.6.0
System:
NodeJS : v16.14.2 (/Users/hans/.nvm/versions/node/v16.14.2/bin/node)
npm : 8.6.0
OS : macOS Monterey
Additional Information
I'm testing on an iPhone 13 Pro with iOS 15.6
The text was updated successfully, but these errors were encountered: