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

Model relay registration triggered by listener registration causes failure

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.9
    • Component/s: Data Binder, IoC System
    • Labels:
      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

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

              Dates

              Created:
              Updated:
              Resolved: