PDA

View Full Version : Sencha Touch in iOS5 doesn't work anymore, even Kitchensink fails



chandramuralis
14 Oct 2011, 11:25 AM
Platform tested against:

iOS 5.0
iPAD1 & iPAD2
Description:

I upgraded my iPad to iOS5 yesterday and started testing our application and at the same time I upgraded our application code to use Sencha Touch 1.1.1 framework that released recently. Safari browser started throwing javascript timeout exception very frequently. So I started testing Kitchensink demo page in iOS5 safari and i got the same timeout exception.
See this URL : http://dev.sencha.com/deploy/touch/examples/kitchensink/


Steps to reproduce the problem:

Go to Kitchen sink demo page in iOS5 Safari and start navigate to different screens. When I tested in iPad1 it took some time to throw the timeout exception but in iPad2 it just showed the exception in the very first screen ( as soon I pressed "User Interface" in the left bar).
The result that was expected:

Work as normal
The result that occurs instead:

Throws javascript timeout exception and makes the application not usable. In the below screenshot we can see how bad Kitchensink page is rendered.
Screenshot or Video:

attached
28684286862868728688

Debugging already done:

none

vgribok
14 Oct 2011, 12:03 PM
Using same iPad 2 upgrade to iOS 5, navigating to http://docs.sencha.com/touch/2-0/touch/examples/kitchensink/, got "Javascript execution exceeded timeout" exception and a blank screen.

vgribok
14 Oct 2011, 12:24 PM
I killed the browser and restarted it - then navigated to ST KitchenSink and had no problem, no exceptions in the beginning. Then after doing different things on different pages, dreaded timeout exception occurred, and since then everything: our app, ST samples - started throwing this error. Even after page is refreshed, script timeout errors are everywhere.

mitchellsimoens
14 Oct 2011, 3:35 PM
Just tried both ST 1.1.0 kitchen sink and ST 2.0 PR1 kitchen sink on iPad 2 with iOS 5 and my new (and shiney) iPhone 4S with iOS 5 and both work no problems. In fact, to me my iPhone seemed faster than my iPad.

mrduck
17 Oct 2011, 1:48 AM
That's weird. It works excellent on my iPad 2 with iOS 5. Same on a colleague.

vgribok
17 Oct 2011, 7:32 AM
http://stackoverflow.com/questions/7787219/javascript-ios5-javascript-execution-exceeded-timeout/7795953

I (http://stackoverflow.com/questions/7787219/javascript-ios5-javascript-execution-exceeded-timeout/7795953)t's not Sencha error, but Sencha needs to pay attention and maybe help with finding the work-around or getting this problem on Apple's radar ASAP.

brandon
23 Oct 2011, 10:53 AM
I just decided to search the 1.x forums and found this thread. I'm having the same "JavaScript execution exceeded timeout" issue on 2.x which I've written up here:

http://www.sencha.com/forum/showthread.php?151956-JavaScript-execution-exceeded-timeout-error

iPhone 4 running iOS 5.

Works fine in the simulator or a desktop browser (Chrome).

Throws the error on the phone.

If I force quit mobile Safari on the phone the error goes away and the app will load.

Tom23
24 Oct 2011, 4:24 AM
If I force quit mobile Safari on the phone the error goes away and the app will load.

Confirmed. On iPhone 4S with iOS5, everything works fine after killing all apps and restarting Safari.

Looks like an OS bug. (see also http://stackoverflow.com/questions/7787219/javascript-ios5-javascript-execution-exceeded-timeout )

chandramuralis
24 Oct 2011, 5:39 AM
Have any of you guys found any solution for this problem?

benmcmath
29 Oct 2011, 1:51 PM
It looks like there is an issue with the 'autoUpdate' feature of the Ext.util.GeoLocation. Setting that to false caused this issue to stop occurring.

This may not fix it for everyone, but it did in my app.

Related thread on stackoverflow: http://stackoverflow.com/questions/7855497/javascript-execution-exceeded-timeout

zzerk
30 Oct 2011, 1:06 PM
I once in a while get this issue as well.
Clearing the cache of the browser fixes the issue for me (iPad 2 / iOS5).

chandramuralis
31 Oct 2011, 12:29 PM
It looks like there is an issue with the 'autoUpdate' feature of the Ext.util.GeoLocation. Setting that to false caused this issue to stop occurring.

This may not fix it for everyone, but it did in my app.

Related thread on stackoverflow: http://stackoverflow.com/questions/7855497/javascript-execution-exceeded-timeout

I replaced WatchPosition with GetCurrentPosition and it fixed this timeout issue and we haven't had any problem now. It seems like WatchPosition implementation has some bug in iOS5.

I also verified this by doing the same with maps.google.com. Before I was able to reproduce the same Javascript timeout exception by following very few steps and reproduce the exception every single time. Now I denied google maps to get my current position and now maps is working fine even with the same exact steps that I follow to generate this timeout exception.

toto83250
5 Nov 2011, 5:43 AM
Same problem with Iphone 4 (8Go) with IOS5 (everything is original, I bought it yesterday).
First, it works well...
Then it doesn't work anymore (idem for Jquery mobile)
After clearing the cache of the browser, the issue is fixed.
Hope it helps !

chandramuralis
5 Nov 2011, 8:08 AM
Same problem with Iphone 4 (8Go) with IOS5 (everything is original, I bought it yesterday).
First, it works well...
Then it doesn't work anymore (idem for Jquery mobile)
After clearing the cache of the browser, the issue is fixed.
Hope it helps !

This is not a one time issue, you are going to get this error continuously and you will end up clearing cache every time.

my8bird
30 Jan 2012, 11:35 AM
Here is a patch I put together so that the project I am working on can move forward from this bug.


/** Fix bug where iOS 5 hates watchPosition for getting updates of users position.
*
* See: http://www.sencha.com/forum/showthread.php?150932
*
* This basically switches to polling system using the getCurrentPosition method
* which iOS 5 does not appear to have an issue with.
*/
Ext.override(Ext.util.GeoLocation, {
setAutoUpdate : function(autoUpdate) {
// Cancel the old one if it is running
if (this.watchOperation !== null) {
clearInterval(this.watchOperation);
this.watchOperation = null;
}
// Early out if we are not updating anymore
if (!autoUpdate) {
return true;
}
// Oops, no geo support
if (!Ext.supports.GeoLocation) {
this.fireEvent('locationerror', this, false, false, true, null);
return false;
}
// Start looping interval for getting the current location.
try{
this.watchOperation = setInterval(Ext.createDelegate(function() {
this.updateLocation();
}, this),
3000); // 3 second frequency is phonegaps setting the spec is not clear on this point.
}
catch(e){
this.autoUpdate = false;
this.fireEvent('locationerror', this, false, false, true, e.message);
return false;
}
return true;
}
});

digeridoo
31 Jan 2012, 5:19 AM
I believe there are a few bugs still in the latest Safari in IOS5.01....I've been having issues with Safari caching old versions when saving to the homescreen, and occasional debug errors in the console for no reason.

I have quit safari completely, then gone back in and all seems to work. So for anyone having weird unexplainable errors try that first...

:-)