PDA

View Full Version : Can't update a production build



rando
12 Apr 2012, 5:38 AM
I'm struggling to update my app once it has been deployed as a production build configured for full updates. The only way I found to refresh my deployed app was to change the application-id in the app.json, which is obviously not good.

Can anyone explain why the following steps fail to refresh a deployed app when using 2.0.1-rc:
create a template app through the sdk: sencha app create mytest /mydir/myapp
change the update configuration in /mydir/myapp/app.json from 'delta' to 'full''
generate the production build: cd /mydir/myapp; sencha app build production
deploy the build/production folder on my server
load the app on Chrome
make a change to the app.js file (add a console.log cmd), regenerate the production build (same as step 3) and redeploy (same as step 4)
reload the app on Chrome (refresh)
the app is not refreshed
I've checked that:
- the app.json file is properly served to the browser (i.e. not cached)
- the app.json includes the updated version id of the app.js file

Initial build/production/app.json:
{"id":"90c27650-84a1-11e1-a17f-7124780ee1ef","js":[{"path":"sdk/sencha-touch.js","type":"js","version":"b7c17f59b485ecb04dc388b2591ea79344917451"},{"path":"app.js","bundle":true,"update":"full","type":"js","version":"6a8ecdf4982956c177eb30187dd365f6cdb3083c"}],"css":[{"path":"resources/css/app.css","update":"full","type":"css","version":"09b5caf1d1319071824911882b7473253753da87"}]}


New build/production/app.json:
{"id":"90c27650-84a1-11e1-a17f-7124780ee1ef","js":[{"path":"sdk/sencha-touch.js","type":"js","version":"b7c17f59b485ecb04dc388b2591ea79344917451"},{"path":"app.js","bundle":true,"update":"full","type":"js","version":"10e2c095c7a49bdcfe13160a693b734e5c58b1e6"}],"css":[{"path":"resources/css/app.css","update":"full","type":"css","version":"09b5caf1d1319071824911882b7473253753da87"}]}

- the app.js file is sent with the valid version in comment.

/*10e2c095c7a49bdcfe13160a693b734e5c58b1e6*/Ext....

What am I missing?

mitchellsimoens
12 Apr 2012, 6:02 AM
Your app won't show the updated version right away. It should execute onUpdated method in the Ext.application and you should then prompt the user if they want to reload the page and if so then reload the page:


Ext.application({
....

onUpdated: function() {
Ext.Msg.confirm(
"Application Update",
"This application has just successfully been updated to the latest version. Reload now?",
function() {
window.location.reload();
}
);
}
});

rando
12 Apr 2012, 12:12 PM
Indeed, but for some reason the onUpdated event doesn't kick off and I'm not prompted to reload.

I've been trying with my own app first which includes the onUpdated function but never managed to receive the event until I discovered I cannot even make it work with the app skeleton generated by the sdk itself.

I simply don't understand what I'm doing wrong.

Jacky Nguyen
13 Apr 2012, 1:02 AM
There's a bug with the production microloader that prevents full updates to be performed properly. The fix is in place for 2.0.1 release, which will be coming out shortly.

Meanwhile, you can grab a copy of its latest code from here (http://dl.dropbox.com/u/4494139/sencha-touch-2.0.1/microloader/production.js.zip). Unzip and replace /path/to/you/app/sdk/microloader/production.js with this, then rebuild your app.

rando
13 Apr 2012, 1:36 AM
Thx Jacky! This now works as expected.

Jacky Nguyen
13 Apr 2012, 1:36 AM
Glad to know that you can confirm the fix ;)

tretiy3
13 May 2012, 3:01 AM
Thanks. It works!

Air41
19 Jun 2012, 7:22 AM
Old or new Issue?
After updating my Development System to:
SDK Tools -2.0.0 beta3 and Sencha Touch 2 SDK - 2.0.1.1 ..
.. i have the same problem like rando. Once i deploy my App as a production build .. 'onUpdated' does not get triggered.


To be more exact:
Safari under iOS (actual Version )does not trigger 'onUpdated' anymore and i'm not prompted to reload the App.
I checked my "build/production url" in Chrome and it works!


Jacky described in this thread a known bug with the production microloader.
Am i facing the same (old) Issue again here or am i missing something?

estesbubba
20 Jun 2012, 7:18 AM
We have also ran into problems where the app would no longer update itself. We have seen this in multiple projects and have went from production build to package build for now. I'll probably try to go back to production since we have a while before the next release goes to production.

Once the app no longer updates you need to delete all site data associated with it. Deleting cookies alone isn't enough.

jep
22 Jul 2012, 8:00 PM
I have run into the same problem with the same config as Air41. Fails to ever call update in iOS or android, but does in Chrome on desktop (XP). Same URL is used for both.

jep
23 Jul 2012, 9:21 AM
Created a bug report:

http://www.sencha.com/forum/showthread.php?232176-Apps-not-auto-updating-when-new-build-is-pushed-(MAJOR-PROBLEM)

Note that I found the auto-update still worked in Chrome on android. Just not the stock browser or Dolphin. Haven't tried Chrome on iOS.

ekunce
29 Jul 2012, 11:01 AM
Same issue here :(

oldgaf
17 Oct 2012, 5:15 AM
Same issue here... on my PC I get the prompt and new ver... on android I get no prompt and no updated app.

Has anyone got anything new to ad to this?

-OG-

subimage
23 Oct 2012, 10:11 AM
Is this fixed? Had to clear my cache on a 2.0.1.1 app to get the latest version of my app.

Schildi
4 Feb 2013, 1:52 PM
Hi guys,

I'm using Sencha Touch 2.1.0-gpl and facing exactly the same issues...can anyone confirm this?
And does anyone have a workaround or even a solution for this?

Best regards,
Schildi

maneljn
12 Feb 2013, 2:15 AM
i'm using Sencha Touch 2.1.1-gpl, and i have the same problem.

With IOS it works good, and refreshes new version app.
With android nothing happens and always shows old webapp version

Anyone has solved ?

maneljn
13 Feb 2013, 12:57 AM
Applying Jackie patch from from here (http://dl.dropbox.com/u/4494139/sencha-touch-2.0.1/microloader/production.js.zip). In my app with Sencha Touch 2.1.1 and Sencha command 3.0.0.230 (windows 7 32 bits), the situation is that this patch repairs the problem in Android 4 , but now the problem appears in IOS 6.
I mean with the patch Android (good) IOS (fails), without the patch Android (fails) IOS (good)

?¿

King Daddy
19 Mar 2013, 7:43 AM
Same issue, using 2.1.1 and Sencha Cmd v3.0.2.288

Any resolution??

vmahajanin
29 Sep 2013, 11:21 PM
Issue present in ST 2.2 as well. I can confirm that Jackie's production.js fixes it on iOS 6 safari and desktop chrome.

vmahajanin
27 Feb 2014, 4:10 AM
Jacky's fix was working well till we were on sencha touch 2.2 and sencha cmd 3.1. But after upgrading to sencha touch 2.3 and sencha cmd 4.0.2.67, with or without Jacky's fix the issue exists. The app.js and other app files in browser local storage just don't update when a new version of the app is pushed. Any ideas?

alexander.urban
2 Apr 2014, 2:23 AM
I am just now trying to debug the microloader.

Debugging someone else's code is not as easy as it sounds... even more so as I have not a single grain of experience in appcache, localstorage etc.