1. #1
    Sencha User
    Join Date
    Mar 2010
    Posts
    26
    Vote Rating
    2
    rando is on a distinguished road

      0  

    Default 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:
    1. create a template app through the sdk: sencha app create mytest /mydir/myapp
    2. change the update configuration in /mydir/myapp/app.json from 'delta' to 'full''
    3. generate the production build: cd /mydir/myapp; sencha app build production
    4. deploy the build/production folder on my server
    5. load the app on Chrome
    6. 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)
    7. reload the app on Chrome (refresh)
    8. 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?

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,754
    Vote Rating
    828
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    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
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Mar 2010
    Posts
    26
    Vote Rating
    2
    rando is on a distinguished road

      0  

    Default


    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.

  4. #4
    Sencha - Sencha Touch Dev Team Jacky Nguyen's Avatar
    Join Date
    Jul 2009
    Location
    Palo Alto, California
    Posts
    469
    Vote Rating
    14
    Jacky Nguyen has a spectacular aura about Jacky Nguyen has a spectacular aura about

      1  

    Default


    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

  5. #5
    Sencha User
    Join Date
    Mar 2010
    Posts
    26
    Vote Rating
    2
    rando is on a distinguished road

      0  

    Default


    Thx Jacky! This now works as expected.

  6. #6
    Sencha - Sencha Touch Dev Team Jacky Nguyen's Avatar
    Join Date
    Jul 2009
    Location
    Palo Alto, California
    Posts
    469
    Vote Rating
    14
    Jacky Nguyen has a spectacular aura about Jacky Nguyen has a spectacular aura about

      0  

    Default


    Glad to know that you can confirm the fix
    Sencha Touch Lead Architect

  7. #7
    Sencha User
    Join Date
    Apr 2012
    Posts
    11
    Vote Rating
    0
    tretiy3 is on a distinguished road

      0  

    Default


    Thanks. It works!

  8. #8
    Touch Premium Member
    Join Date
    Jul 2011
    Posts
    12
    Vote Rating
    0
    Air41 is on a distinguished road

      0  

    Default


    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?

  9. #9
    Ext JS Premium Member
    Join Date
    Apr 2010
    Location
    Omaha, NE
    Posts
    555
    Vote Rating
    24
    estesbubba will become famous soon enough estesbubba will become famous soon enough

      1  

    Default


    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.

  10. #10
    Sencha User jep's Avatar
    Join Date
    Sep 2010
    Posts
    862
    Vote Rating
    21
    jep will become famous soon enough jep will become famous soon enough

      0  

    Default


    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.

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi