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

Protocomponent utilities in RendererUtilities fail to support new model for ChangeApplier



    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.5
    • Data Binder, Renderer
    • None


      FLUID-3674 introduced major changes to the model semantic for the ChangeApplier. The scope of these is described at http://wiki.fluidproject.org/display/fluid/New+Notes+on+the+ChangeApplier . Unfortunately, one of the clients of the old ChangeApplier that got caught out is our own RendererUtilities for working on the so-called "protoComponents". Although we plan to remove all of this renderer architecture wholesale, we need to keep it working in the meantime. cindyli ran into this bug whilst working on the metadata component, original test case supplied at https://github.com/amb26/infusion/pull/3/files . This issue can be demonstrated a good deal more simply than this, and is caused by the fact that the entire protocomponent expansion pathway closes over the reference to "model" at the outset and will therefore ignore all changes supplied via the new ChangeApplier which repeatedly rebind this reference at the end of each transaction.

      From RendererUtilities.js line 535:

      var expandConfig = {
      model: options.model,

      This evil runs deep! Rather than pollute all of this code with references to "holder" etc. a quick enough hack should be to manually rebind to the model whenever we receive a "refreshView" since is the only lifecycle point at which protocomponent work should be occurring. This fix to this doomed architecture only needs to be "good enough" ...

      Both "options" and "expandConfig" -> "config" are sources of this reference pollution


        Issue Links



              cindyli Cindy Qi Li
              antranig Antranig Basman
              0 Vote for this issue
              3 Start watching this issue