1. #1
    Sencha User
    Join Date
    Apr 2011
    Posts
    134
    Vote Rating
    1
    stefankendall is an unknown quantity at this point

      0  

    Exclamation Only one of my models is saving.

    Only one of my models is saving.


    I have a handful of models, but only one seems to be doing any sort of syncstorage saving. In the following example, "LiftCompletion" saves, but "Lift" does not. I see "getUpdates()" in the console when I call sync on its store, but I don't see the flood of information that syncing LiftCompletion gives, and when I refresh my browser (testing locally), only the LiftCompletion is saved.

    Why might this be happening? I can't go forward until all my models sync.

    Code:
    Ext.regModel('Lift', {
        fields:[
            {name:'id', type:'integer'},
            {name:'name', type:'string'},
            {name:'propertyName', type:'string'},
            {name:'max', type:'float'},
            {name:'cycleIncrease', type:'float'}
        ],
        validations:[
            {field:'propertyName', type:'custom', message:'nonunique',
                fn:wendler.models.Lift.uniquePropertyNameValidation},
            {field:'propertyName', type:'presence'},
            {field:'max', type:'format', matcher:/^\d\d*$/, message:'Must enter a max'},
            {field:'max', type:'presence'},
            {field:'cycleIncrease', type:'presence'}
        ],
        proxy:{
            key: 'stefankendall',
            type:'syncstorage',
            id:'lift-proxy'
        }
    });
    Code:
    Ext.regModel('LiftCompletion', {
        fields:[
            {name:'id', type:'integer'},
            {name:'liftPropertyName', type:'string'},
            {name:'week', type:'integer'},
            {name:'completed', type:'boolean'}
        ],
        proxy:{
            key: 'stefankendall',
            type:'syncstorage',
            id:'lift-completion-proxy'
        }
    });

  2. #2
    Sencha User
    Join Date
    Oct 2011
    Location
    Germany
    Posts
    147
    Vote Rating
    10
    Möhre will become famous soon enough

      0  

    Default


    Which Sencha Touch Version? Which IO-SDK?

    I would test...
    - to strip off the validations
    - a different proxy-id (change name)

  3. #3
    Sencha User
    Join Date
    Apr 2010
    Posts
    107
    Vote Rating
    -1
    merrells is an unknown quantity at this point

      0  

    Default


    Hello,

    I good first test is to get your models working with the regular local store first. Try that.

    The only think in your code that I noticed might be a problem is the declaration of 'id' as an integer. That might cause problems. 'string' would be better.

    John

  4. #4
    Sencha User
    Join Date
    Apr 2011
    Posts
    134
    Vote Rating
    1
    stefankendall is an unknown quantity at this point

      0  

    Default


    Switching the IDs worked, but why? Is there any way to clear a corrupted store? I'd like to be able to migrate existing localStorage data for each user using the localstorage proxy, although localstorage seems broken in 1.2.0-alpha-whatever-sync version.

    If I switch to 1.2.0-alpha..., and only make that change, my application is broken due to random localstorage breakage.

    Is there a better way to use Sencha IO with 1.1.1?

  5. #5
    Sencha User
    Join Date
    Apr 2010
    Posts
    107
    Vote Rating
    -1
    merrells is an unknown quantity at this point

      0  

    Default


    > Switching the IDs worked, but why?

    Sync uses IDs that are multi-part (x-y-z), so are saved as strings.
    By declaring it an integer it was probably truncating the ID.

    > Is there a better way to use Sencha IO with 1.1.1?

    No, unfortunately not. Only the very first alpha releases of SIO were
    targeted to ST1. The current release works with ST2 PR2. We'll be
    releasing an update to SIO once ST2 ships.

    John

  6. #6
    Sencha User
    Join Date
    Apr 2011
    Posts
    134
    Vote Rating
    1
    stefankendall is an unknown quantity at this point

      0  

    Default


    I've switched all my ids to strings, and I might be able to handle the data migration manually by inspecting localStorage. This sucks, but it's doable.

    Now, when I change data and reload locally, data is persisted.

    However, when I clear my cache and reload, all my stores' load events fire with a count of 0, which causes default data to start to be written. Some of my stores then start throwing errors like this:

    Code:
    Error: Record has already been created.{"liftPropertyName":"squat","week":1,"completed":false,"id":"0-33779868","_state":{"_oid":"0-33779868","liftPropertyName":"0-33779868-1","week":"0-33779868-2","completed":"0-33779868-3","id":"0-33779868-4"},"_oid":"0-33779868","_ts":"","_ref":"","_model":""}
    Why is this happening? I would expect the load events to *not* fire until updates have been retrieved.

  7. #7
    Sencha User
    Join Date
    Apr 2010
    Posts
    107
    Vote Rating
    -1
    merrells is an unknown quantity at this point

      0  

    Default


    Hello,

    I'm sorry but that problem doesn't sound familiar to me, and off the top of my head I'm not sure why that would ever happen.

    ST1 + SIO is a long time ago for us, and we're working hard to keep pace with ST2.

    John

  8. #8
    Sencha User
    Join Date
    Apr 2011
    Posts
    134
    Vote Rating
    1
    stefankendall is an unknown quantity at this point

      0  

    Default


    I understand. My main blocker for not using ST2 was localstorage breakage. If sync storage works, I can navigate the other bugs.

    What version of IO and ST2 should I migrate to? My choices are use Sencha IO or build it myself, and if I want to confidently release a fix this weekend, a migration to ST2 is more viable.

    One way or another, I'm resolving the "I lost all my data and you're terrible" emails.

  9. #9
    Sencha User
    Join Date
    Apr 2010
    Posts
    107
    Vote Rating
    -1
    merrells is an unknown quantity at this point

      0  

    Default


    > I understand. My main blocker for not using ST2 was localstorage breakage.
    > If sync storage works, I can navigate the other bugs.

    syncstorage uses localstorage, so it's not an either/or choice.

    localstorage in ST2 PR4 is better than either ST1 or ST2 PR2, but there are still a few problems, which will be resolved in the next release of ST2.

    > What version of IO and ST2 should I migrate to?

    The best combination right now is ST2 PR2 + SIO b3.
    But, you will find plenty of UI related issues in PR2.

    > My choices are use Sencha IO or build it myself, and if I want to confidently release
    > a fix this weekend, a migration to ST2 is more viable.

    Tricky.

    > One way or another, I'm resolving the "I lost all my data and you're terrible" emails.

    Yeah, not nice. SIO is intended to make user's data more durable. We're just not quite done yet...

    John

  10. #10
    Sencha User
    Join Date
    Apr 2011
    Posts
    134
    Vote Rating
    1
    stefankendall is an unknown quantity at this point

      0  

    Default


    I have faith you'll get there. Beta means bleeding all over the product, I guess.

    I'll try PR2 and wait for the beta. I tried to migrate to ST2 once already, so I think I can reliably navigate the UI issues.

    Hopefully the migration tonight goes well, eh.

Thread Participants: 2

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