You found a bug! We've classified it as TOUCH-4076 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User
    Join Date
    Mar 2013
    Posts
    1
    Vote Rating
    0
    customdev is on a distinguished road

      0  

    Default Ext.data.Model.cache returns data from the wrong store

    Ext.data.Model.cache returns data from the wrong store


    REQUIRED INFORMATION


    Ext version tested:
    • Sencha Touch 2.0.1.1
    Browser versions tested against:
    • WebKit for iOS 4
    • WebKit for iOS 5
    • WebKit for iOS 6
    • WebKit for Android 2.x
    • WebKit for Android 4.x
    DOCTYPE tested against:
    • html
    Description:
    • Ext.data.Model.cache returns data from the wrong store.
    Steps to reproduce the problem:
    • Create two stores based on the same model.
    • Add one entry to each store and use the same ID for each entry.
    • Do a getById() on the first store.
    The result that was expected:
    • You get the record from the first store.
    The result that occurs instead:
    • You get the record from the second store.
    Test Case:

    Code:
    Ext.define("ModelBugTest.model.KeyValuePair", {
        extend: "Ext.data.Model",
        config: {
            idProperty: "key",
            fields: [
                {name: "key", type: "string"},
                {name: "value", type: "string"}
            ]
        }
    });
    
    [...]
    
    Ext.define("ModelBugTest.store.KeyValuePairs1", {
            extend: "Ext.data.Store",
            requires: "Ext.data.proxy.LocalStorage",
            config: {
                model: "ModelBugTest.model.KeyValuePair",
                proxy: {
                    type: "localstorage",
                    id: "keyvaluepairs1"
                }
            }
        }
    );
    
    [...]
    
    Ext.define("ModelBugTest.store.KeyValuePairs2", {
            extend: "Ext.data.Store",
            requires: "Ext.data.proxy.LocalStorage",
            config: {
                model: "ModelBugTest.model.KeyValuePair",
                proxy: {
                    type: "localstorage",
                    id: "keyvaluepairs2"
                }
            }
        }
    );
    
    [...]
    
    Ext.application({
        name: "ModelBugTest",
    
        models: ["KeyValuePair"],
        stores: ["KeyValuePairs1", "KeyValuePairs2"],
    
        launch: function() {
        var record1 = Ext.create("ModelBugTest.model.KeyValuePair", {
            key: "key",
            value: "value1"
        });
        record1.setDirty();
        
        var store1 = Ext.getStore("KeyValuePairs1");
        store1.add(record1);
        store1.sync();
    
        var record2 = Ext.create("ModelBugTest.model.KeyValuePair", {
            key: "key",
            value: "value2"
        });
        record2.setDirty();
    
        var store2 = Ext.getStore("KeyValuePairs2");
        store2.add(record2);
        store2.sync();
    
        var record = store1.getById("key");
        if (record) {
            alert("" + record.get("value"));
        }
        }
    });


    HELPFUL INFORMATION


    Debugging already done:
    • Ext.data.Model.cache returns data from the wrong store in Ext.data.Model constructor method (lines 518-523 of src/data/Model.js).
    Possible fix:
    • Set useCache config property of Ext.data.Model to false in Sencha Touch 2.1.1.
    • No fix in Sencha Touch 2.0.1.1.
    Operating System:
    • OS X 10.8
    • Windows 7

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,801
    Vote Rating
    834
    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


    Thanks for the report! I have opened a bug in our bug tracker.

  3. #3
    Ext JS Premium Member
    Join Date
    Oct 2010
    Posts
    103
    Vote Rating
    6
    abierbaum is on a distinguished road

      0  

    Default


    Any update on this bug? It seems like the useCache flag causes quite a bit of confusion in places like this.

Thread Participants: 2

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