-
12 Apr 2012 5:38 AM #1
Can't update a production build
Can't update a production build
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
- 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?
-
12 Apr 2012 6:02 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
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:
Code: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(); } ); } });Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
12 Apr 2012 12:12 PM #3
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.
-
13 Apr 2012 1:02 AM #4Sencha - Sencha Touch Dev Team
- Join Date
- Jul 2009
- Location
- Palo Alto, California
- Posts
- 469
- Vote Rating
- 9
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. Unzip and replace /path/to/you/app/sdk/microloader/production.js with this, then rebuild your app.Sencha Touch Lead Architect
-
13 Apr 2012 1:36 AM #5
-
13 Apr 2012 1:36 AM #6Sencha - Sencha Touch Dev Team
- Join Date
- Jul 2009
- Location
- Palo Alto, California
- Posts
- 469
- Vote Rating
- 9
Glad to know that you can confirm the fix
Sencha Touch Lead Architect
-
13 May 2012 3:01 AM #7
-
19 Jun 2012 7:22 AM #8
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?
-
20 Jun 2012 7:18 AM #9
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.
-
22 Jul 2012 8:00 PM #10
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.


Reply With Quote