Results 1 to 3 of 3

Thread: Race condition with ViewModel formulas and Model loads

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext JS Premium Member
    Join Date
    Oct 2007
    Posts
    128

    Default Race condition with ViewModel formulas and Model loads

    This one is hard to describe, so the fiddle is the best way to see the issue.

    In the fiddle I have a Panel with a ViewModel and a bound title to a formula. When the fiddle loads, there is a 5 second delay on the simulated ajax call. You'll see the title appear after that.

    Pressing the button changes a dependent value for the formula, and then reloads the Model. The title disappears while the load() is in progress. My expectation would be that the Model data would continue to be valid while the load is in progress.

    https://fiddle.sencha.com/#fiddle/sol

  2. #2
    Sencha Premium User
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,258

    Default

    It's not really a bug, though a somewhat interesting behaviour. Because the viewmodel operates on a timer, as described in the documentation, by the time the binding fires from the set() call, the model is already loading, so it skips out because the load is in progress so it should wait before firing off any data.

  3. #3
    Ext JS Premium Member
    Join Date
    Oct 2007
    Posts
    128

    Default

    I had a feeling that might be the case but I did notice something strange on occasion.. the formula would be called immediately and provide the proper value, then called with null values, and then called again after the load. I wasn't able to determine why it was being triggered 3 times.

    I won't argue that it's a bug but I would consider this behavior to be undesirable. For one, while the load is in progress, the model has valid data (or enough data to satisfy the formula). You might also just simply defer bindings that depend on loading models.

Similar Threads

  1. [4.0.6] Race condition in Ext.LoadMask
    By SamuraiJack1 in forum Ext:Bugs
    Replies: 1
    Last Post: 28 Sep 2011, 10:04 PM
  2. Resolve Race Condition
    By Tuckerific in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 30 Mar 2010, 11:12 PM
  3. Race condition in Ext.Log?
    By mankz in forum Community Discussion
    Replies: 5
    Last Post: 30 Dec 2008, 12:46 PM
  4. Weird race condition (I think) due to a-jax
    By frew in forum Sencha Ext JS Q&A
    Replies: 14
    Last Post: 27 Oct 2008, 5:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •