Success! Looks like we've fixed this one. According to our records the fix was applied for DSGNR-3755 in a recent build.
  1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    4
    Vote Rating
    1
    penguintux is on a distinguished road

      1  

    Default Sencha Architect 2.2.1 Build:951, binding an exception event error

    Sencha Architect 2.2.1 Build:951, binding an exception event error


    Binding an exception event to JsonReader of a Proxy could results in incomplete code injection.

    constructor: function() {
    var me = this;
    me.callParent(arguments);
    me.getProxy().getReader().on([
    },

  2. #2
    Sencha - Architect Dev Team dfoelber's Avatar
    Join Date
    Sep 2011
    Location
    Rockville, MD
    Posts
    96
    Vote Rating
    12
    dfoelber will become famous soon enough

      0  

    Default


    Hi,

    Thanks for the feedback! That definitely is not right, I made a ticket for the issue.

  3. #3
    Sencha User joostvanhassel's Avatar
    Join Date
    Jan 2012
    Location
    Rotterdam, The Netherlands
    Posts
    102
    Vote Rating
    1
    joostvanhassel is on a distinguished road

      0  

    Exclamation


    This is a major problem for all my projects, as all of them use exception handlers. Is this a high priority issue at Sencha?

  4. #4
    Sencha Premium Member
    Join Date
    Mar 2012
    Location
    Boise, Idaho
    Posts
    84
    Vote Rating
    13
    PhilMerrell will become famous soon enough

      0  

    Default work around

    work around


    We came across this also. Our work around (maybe you've already done this...) was to attach a listener to the store proxy using the, 'beforeload' event of the store:

    Code:
    onStoreBeforeLoad: function(store, operation, eOpts) {
        store.getProxy().on('exception', function() {
    
    
            // Your exception logic...
        });
    }
    Or if you need it on your reader of course...

    Code:
    onStoreBeforeLoad: function(store, operation, eOpts) {
        store.getProxy().getReader().on('exception', function() {
    
            // Your exception logic...
    
        });
    }

  5. #5
    Sencha User joostvanhassel's Avatar
    Join Date
    Jan 2012
    Location
    Rotterdam, The Netherlands
    Posts
    102
    Vote Rating
    1
    joostvanhassel is on a distinguished road

      0  

    Default


    This looks like a fine work around for now. Just make sure you only bind this listener just once. The example code will bind again if you reload the store.

    Thanks for sharing!
    Last edited by joostvanhassel; 7 May 2013 at 2:48 PM. Reason: Typo

  6. #6
    Sencha Premium Member
    Join Date
    Mar 2012
    Location
    Boise, Idaho
    Posts
    84
    Vote Rating
    13
    PhilMerrell will become famous soon enough

      0  

    Default


    Quote Originally Posted by joostvanhassel View Post
    This looks like a fine work around for now. Just make sure you only bind this listener just once. The example code will bind again if you reload the store.

    Thanks for sharing!
    Good point! I hadn't thought of that.

    Happy to share.

  7. #7
    Sencha User kitesurf's Avatar
    Join Date
    Jan 2012
    Location
    London, England
    Posts
    72
    Vote Rating
    2
    kitesurf is on a distinguished road

      0  

    Default Work around doesn't seem to work?

    Work around doesn't seem to work?


    Hi!

    Can anyone explain the steps they used in Architect to get around this bug? I've tried adding the 'beforeload' event to my store in Architect but this doesn't resolve the issue. The auto-generated code is still broken.

    thanks!

    Code:
    Ext.define('Aries.store.AccountsStore', {
        extend: 'Ext.data.Store',
    
        requires: [
            'Aries.model.AccountModel'
        ],
    
        config: {
            model: 'Aries.model.AccountModel',
            storeId: 'AccountsStore',
            proxy: {
                type: 'ajax',
                reader: {
                    type: 'json'
                }
            },
            grouper: {
                groupFn: function(record) {
                    return record.get('clientName')[0];
                }
            },
            listeners: [
                {
                    fn: 'onJsonstoreBeforeLoad',
                    event: 'beforeload'
                }
            ]
        },
    
        constructor: function() {
            var me = this;
            me.callParent(arguments);
            me.getProxy().getReader().on([
        },
    
        onJsonException: function(reader, response, error, eOpts) {
            console.log("Unable to load account list - user may have expired session - redirect to login");
            window.location = '#dataException';
        },
    
        onJsonstoreBeforeLoad: function(store, operation, eOpts) {
            // nothing here - added to try and fix architect bug
        }
    
    });

  8. #8
    Sencha User joostvanhassel's Avatar
    Join Date
    Jan 2012
    Location
    Rotterdam, The Netherlands
    Posts
    102
    Vote Rating
    1
    joostvanhassel is on a distinguished road

      1  

    Default


    Quote Originally Posted by kitesurf View Post
    Can anyone explain the steps they used in Architect to get around this bug? I've tried adding the 'beforeload' event to my store in Architect but this doesn't resolve the issue. The auto-generated code is still broken.
    @kitesurf: To use the workaround, remove your exceptionhandler and dynamically bind it in the beforeload handler as PhilMerrell suggested;

    Code:
    onStoreBeforeLoad: function(store, operation, eOpts) {
      store.getProxy().on('exception', function() {
        // Your exception logic...
      });
    }
    @sencha / @dfoelber : This bug is now over 3 months old. I know things have been busy around SenchaCon, but maybe someone can look at this, as this is a pretty major bug in Architect.
    Last edited by joostvanhassel; 25 Jul 2013 at 12:23 PM. Reason: missing code tags

  9. #9
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,105
    Vote Rating
    114
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Quote Originally Posted by joostvanhassel View Post
    @sencha / @dfoelber : This bug is now over 3 months old. I know things have been busy around SenchaCon, but maybe someone can look at this, as this is a pretty major bug in Architect.
    Agreed! As you expected, we've been pretty slammed getting 3.0 preview out the door. This is on the list of critical bugs to address.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  10. #10
    Sencha User joostvanhassel's Avatar
    Join Date
    Jan 2012
    Location
    Rotterdam, The Netherlands
    Posts
    102
    Vote Rating
    1
    joostvanhassel is on a distinguished road

      0  

    Default


    Quote Originally Posted by aconran View Post
    Agreed! As you expected, we've been pretty slammed getting 3.0 preview out the door. This is on the list of critical bugs to address.
    Thanks for your reply Aaron! Will this be fixed in a point release for the 2.x branch too?