1. #1
    Sencha Premium Member TheStreet's Avatar
    Join Date
    Sep 2012
    Posts
    63
    Vote Rating
    0
    TheStreet is on a distinguished road

      0  

    Default Possible Race Condition on Simulator/Device

    Possible Race Condition on Simulator/Device


    I am running some logic in the method posted below that works fine in a desktop browser but returns an undefined value in the device/simulator. I'm thinking this is some kind of race condition, but maybe someone can shine a light as to why I am seeing this inconsistent behavior. All of this is popping off when someone clicks on a dataview item.

    Code:
        onArticleSelect: function(view, record, eOpts) {
            var store             = view.getStore(),
                first             = store.first(),
                recordId          = record.getId(),
                storeId           = store.getStoreId().toString(),
                sectionRaw        = storeId.replace(/([A-Z])/g, ' $1'),
                sectionTitle      = sectionRaw.replace(/^\s+|\s+$/g, ""),
                articleCarousel   = this.getArticleCarousel(),
                articlePanel      = this.getArticlePanel(),
                article           = this.getArticle(),
                //articleId         = articleCarousel.getActiveItem().getId(),
                dashboardPanel    = this.getDashboardPanel(),
                dashboard         = this.getDashboard(),
                splash            = this.getSplash(),
                dashboardCarousel = this.getDashboardCarousel(),
                storeItems        = storeId+'Items',
                articleSection    = this.getArticleSection(),
                viewIdReplace     = view.getId().replace(/Feed$/g, ''),
                items             = [];
    
    
            view.deselectAll();
    
    
            if(articleCarousel.items.length !== 0) {
                console.log(articleCarousel.items.length); //returns length properly in desktop browser and simulator/device
                console.log(articleCarousel.getActiveItem().sid); //returns sid property in desktop browser but returns undefined on simulator/device
                console.log(articleCarousel.getActiveItem().id); //returns id property in desktop browser and simulator/device
                console.log(viewIdReplace); //returns properly on both desktop browser and device
            }
            
    
    
            if(articleCarousel.items.length === 0) {
                console.log('initializing all articles...');
                console.log('store: ', store);
                //articleCarousel.setMasked(true);
                store.each(function(rec, offset) {
                    var recId = rec.data.articleId.toString(),
                        storeName = store.getStoreId();
    
    
                    items.push(Ext.create('TheStreet.view.Article', {
                        sid: storeName,
                        record: rec,
                        id: recId
                    }));
                });
                articleCarousel.setItems(items);
                //articleCarousel.setMasked(false);
            } else if ((articleCarousel.items.length !== 0) && (articleCarousel.getActiveItem().sid !== viewIdReplace)) {
                console.log('replacing all articles...');
                articleCarousel.removeAll();
                //articleCarousel.setMasked(true);
                store.each(function(rec, offset) {
                    var recId = rec.data.articleId.toString(),
                        storeName = store.getStoreId();
                        
                    items.push(Ext.create('TheStreet.view.Article', {
                        sid: storeName,
                        record: rec,
                        id: recId
                    }));
                });
                articleCarousel.setItems(items);
                //articleCarousel.setMasked(false);
            }
    
    
    
    
            articleSection.setHtml('<h4>News :: '+sectionTitle+'</h4>');
            dashboardPanel.hide(true);
            articlePanel.show(true);
            articleCarousel.setActiveItem(Ext.getCmp(record.data.articleId.toString()));
        }

  2. #2
    Sencha Premium Member TheStreet's Avatar
    Join Date
    Sep 2012
    Posts
    63
    Vote Rating
    0
    TheStreet is on a distinguished road

      0  

    Default Update (Behavior is now consistent in browser and device)

    Update (Behavior is now consistent in browser and device)


    As an update I thought it might help someone to know that this is only an issue after the app has been built with SDK Tools and I was able to reproduce this behavior in the desktop browser when running the production build of my app. Any ideas why an object property would be defined running the app with the Loader in a test environment and not after it's been built?

  3. #3
    Sencha Premium Member TheStreet's Avatar
    Join Date
    Sep 2012
    Posts
    63
    Vote Rating
    0
    TheStreet is on a distinguished road

      0  

    Default I'm from New Yawk too Sonnn

    I'm from New Yawk too Sonnn


    My bad dude. iOS 5.1 and 6.0 simulator and iOS device. Sencha Touch 2.0.1. PhoneGap 2.1.

  4. #4
    Sencha Premium Member TheStreet's Avatar
    Join Date
    Sep 2012
    Posts
    63
    Vote Rating
    0
    TheStreet is on a distinguished road

      0  

    Default


    Anyone? I'm going to submit this as a bug if no one has any idea what I could possibly be doing wrong.

Tags for this Thread

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