Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.
  1. #1
    Sencha User
    Join Date
    May 2011
    Location
    Northern California
    Posts
    255
    Vote Rating
    17
    BillHubbard has a spectacular aura about BillHubbard has a spectacular aura about BillHubbard has a spectacular aura about

      1  

    Default [ExtJS 4.1.1] Ext.require does not call callback if provided

    [ExtJS 4.1.1] Ext.require does not call callback if provided


    If I pass a callback fn to Ext.require, it never gets called. For example, Ext.require('Sjs.apps.examples.reference.Main', function() { console.log('loaded'); });

    This problem appeared in 4.1.0 and is critical to the proper functioning of our environment. This is blocking us from upgrading from 4.0.7.

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,124
    Vote Rating
    514
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Works ok for me:

    Code:
    Ext.require('Ext.panel.Panel', function(){
        console.log('Foo');
    });
    I tried it with ext-all.js and also dynamic loading against 4.1.1, the log fires in both cases.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha User
    Join Date
    May 2011
    Location
    Northern California
    Posts
    255
    Vote Rating
    17
    BillHubbard has a spectacular aura about BillHubbard has a spectacular aura about BillHubbard has a spectacular aura about

      1  

    Default


    Ok, well I'll have to do more digging and see if I can create an example to show the problem. In our environment, we define application classes that extend Ext.app.Application, and when an app is required on the page, Ext.require is called, passing the app class name and a callback. 100% of the time, the callback never gets called because of this line in Loader.js:
    Code:
          if (syncModeEnabled) {
               callback.call(scope); 
     ...
    syncModeEnabled is always false. The callback never gets called.

    By the way, I'm using ext-dev.js. Also, the code I am using that doesn't work in 4.1.1, works fine in 4.0.5.

  4. #4
    Sencha User
    Join Date
    May 2011
    Location
    Northern California
    Posts
    255
    Vote Rating
    17
    BillHubbard has a spectacular aura about BillHubbard has a spectacular aura about BillHubbard has a spectacular aura about

      1  

    Default


    Interestingly, if I call Ext.syncRequire(someClass, callback), then ALL the callbacks that never got called from previous Ext.require calls suddenly get invoked. Then I get a "field is undefined" exception on Model.js.

    It is difficult to create a standalone example outside of our environment, but I'll see what I can do. But something has definitely changed with the Loader since 4.0.5.

  5. #5
    Sencha User
    Join Date
    May 2011
    Location
    Northern California
    Posts
    255
    Vote Rating
    17
    BillHubbard has a spectacular aura about BillHubbard has a spectacular aura about BillHubbard has a spectacular aura about

      1  

    Default


    Here's a big clue:
    When our main page loads, we wind up in a state where Ext.Loader.numPendingFiles == 4. The pending files turn out to be the scripts for the classes Ext.LoadMask, Ext.Ajax, Ext.data.Store and Ext.data.AbstractStore.

    Coincidentally, in the Ext.Loader.loadScriptFile method, there is this code:
    Code:
    if (isFileLoaded[url]) {
        return Loader; 
    }
    If I write the url to the console at this point, guess what files I see?
    Code:
    http://hom-bhubbard3/assets/scripts/deploy/ext-live/src/data/AbstractStore.js already loaded
    http://hom-bhubbard3/assets/scripts/deploy/ext-live/src/data/Store.js already loaded
    http://hom-bhubbard3/assets/scripts/deploy/ext-live/src/Ajax.js already loaded
    http://hom-bhubbard3/assets/scripts/deploy/ext-live/src/LoadMask.js already loaded
    Having that check in loadScriptFile prevents the onLoad handler from getting called. This check was not present in 4.0.5. The expectation is that the onLoad handler should always get called, even if the file is already loaded. That's not happening.

  6. #6
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,124
    Vote Rating
    514
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      -2  

    Default


    I still see the callback fired:

    Code:
    Ext.require('Ext.panel.Panel');
    
    Ext.onReady(function() {
        
        Ext.require('Ext.panel.Panel', function(){
            console.log('loaded');
        });
        
    });
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  7. #7
    Sencha User
    Join Date
    May 2011
    Location
    Northern California
    Posts
    255
    Vote Rating
    17
    BillHubbard has a spectacular aura about BillHubbard has a spectacular aura about BillHubbard has a spectacular aura about

      1  

    Default


    That is too simplistic of an example. Our environment loads numerous apps on the same page, and it seems in the process, somehow the require requests hit a condition whereby loadScriptFile is getting called twice for the same file.

    I had to patch Loader.js with the following code to make it work. Please get this pushed into the product. This was a difficult method to override due to closure references created when ExtJS code was optimized.
    Code:
            loadScriptFile: function(url, onLoad, onError, scope, synchronous) {
    
                if (isFileLoaded[url]) {
                    if (synchronous) {
                        onLoad.call(scope);
                    } else {
                        defer(onLoad, 10, scope);
                    }
                    return Loader;
                }
        ...

    Quote Originally Posted by evant View Post
    I still see the callback fired:

    Code:
    Ext.require('Ext.panel.Panel');
    
    Ext.onReady(function() {
        
        Ext.require('Ext.panel.Panel', function(){
            console.log('loaded');
        });
        
    });

  8. #8
    Sencha User
    Join Date
    May 2011
    Location
    Northern California
    Posts
    255
    Vote Rating
    17
    BillHubbard has a spectacular aura about BillHubbard has a spectacular aura about BillHubbard has a spectacular aura about

      1  

    Default


    Further investigation reveals there is something going on that is influenced by network latency, as I wind up with anywhere from three to five classes for which loadScriptFile gets called twice. And with the fix I mentioned previously, I am now occasionally seeing numPendingFiles go negative, suggesting an onLoad callback is getting called twice. There's definitely something screwy going on, as everything just works in 4.0.5 and 4.0.7 and then everything stops working in 4.1.0.

  9. #9
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,124
    Vote Rating
    514
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      1  

    Default


    It's almost impossible to say without seeing a test case, because:

    a) We need to be able to reproduce it to figure out if/what the problem is
    b) We need to be able to reproduce it so we can verify it's fixed if there is a bug
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  10. #10
    Sencha User
    Join Date
    May 2011
    Location
    Northern California
    Posts
    255
    Vote Rating
    17
    BillHubbard has a spectacular aura about BillHubbard has a spectacular aura about BillHubbard has a spectacular aura about

      1  

    Default


    I understand. And it's almost impossible to build a test case to show the problem when I don't know what's causing it, especially when is seems there's a few too many variables involved. I'm providing as much information as I collect about the problem, since I figured you guys wrote the code, so maybe you are more familiar with it than I am and might glean some clue about what could be the problem. We've got a lot riding on this and time is money, so I'm doing what I can to find the cause. Do I need to go through premium support for assistance?

    Quote Originally Posted by evant View Post
    It's almost impossible to say without seeing a test case, because:

    a) We need to be able to reproduce it to figure out if/what the problem is
    b) We need to be able to reproduce it so we can verify it's fixed if there is a bug

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar