Uploaded image for project: 'Fluid Infusion'
  1. Fluid Infusion
  2. FLUID-5489

ChangeApplier provides notification of some null changes - full diff algorithm is required

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: 2.0
    • Component/s: Data Binder
    • Labels:
      None

      Description

      Whilst the new ChangeApplier is much more capable than the old in filtering out the effects of "null changes", there are still situations in which it may annoy the client by providing notifications where there has been no actual change to the model value of interest. The new "cautious applier" at least guarantees never to provide a notification where there has been no change to the overall model, but it can still be fooled in cases of "overbroad changes" (traditionally a bugbear of the ChangeApplier algorithm). Consider the following situation -

      i) initial model value: undefined
      ii) listener registered at path "innerPath"
      iii) model changed to value {}

      Since the root path of the model has been invalidated, our patch matching algorithm will create a changeMap consisting of "ADD" at the root - this will actually notify every listener at every path, even though only a listener actually registered at path "" will see a changed value.

      We should improve the ChangeApplier so that it can guarantee to only notify a listener in the case there is a change in the value it is observing.

      It's a good time to tidy up on various other ChangeApplier issues. The simplest way to deliver on the headline issue in this JIRA is to implement a full "diff" algorithm (which can be done quite simply on the back of the existing cautious applier). This will be useful in other projects amongst the GPII also. See FLUID-5490 also.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              antranig Antranig Basman
              Reporter:
              antranig Antranig Basman
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: