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

Model relay registration triggered by listener registration causes failure

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.9
    • None
    • Data Binder, IoC System
    • None

    Description

      The following setup:

          fluid.defaults("flock.enviro", {
              gradeNames: ["fluid.standardRelayComponent", "flock.nodeList", "autoInit"],
      ....
              listeners: {
                  onPlay: "{audioStrategy}.startGeneratingSamples()",
      ....
              components: {
      
                  audioStrategy: {
                      type: "flock.audioStrategy.platform",
                      options: {
                          model: {
                              playState: "{enviro}.model.playState"
                          }
                      }
                  }
      

      where audioStrategy has

              invokers: {
                  startGeneratingSamples: {
                      funcName: "flock.audioStrategy.web.start",
                      args: ["{that}.model", ....
      

      causes a failure, DataBinding.js line 453 during

              var targetApplier = options.targetApplier || target.applier; // implies the target is a relay document
              var sourceApplier = options.sourceApplier || source.applier; // implies the source is a relay document - listener will be transactional
              var applierId = targetApplier.applierId;
      

      The workflow is -
      i) initialisation of enviro reaches "registerListeners" - this observes its child, audioStrategy, and then observes that it has a model section which requires relay to the parent. This then binds ungingerly onto the parent's model and discovers that the applier is absent - since the "last-ditch" construction point is actually during enviro's initDependents which is far in the future. We should fix this simply by making sure that relay performs ginger observation of target's applier before use.

      Attachments

        Activity

          People

            antranig Antranig Basman
            antranig Antranig Basman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: