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

Options distribution with shorter-lived sibling as head causes bare failure on destruction of source

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Framework, IoC System
    • Labels:
      None

      Description

      There's a fault in our bookkeeping of options distributions. The destruction of a target should clear out its entry in "shadow.outDistributions" but this doesn't account for the case where the head of the distribution source selector is shorter-lived than the actual distribution source component. The following configuration:

      fluid.defaults("gpii.flowManager.pcpChannel", {
          gradeNames: ["fluid.modelComponent"],
          distributeOptions: {
              target: "{lifecycleManager session}.options.modelRelay",
              record: {
                  "pcpChannel": {
                      "source": {
                          segs: []
                      },
                      "target": "{flowManager}.pcpChannel.model",
                      "singleTransform": {
                          type: "fluid.transforms.identity"
                      }
                  }
              }
          }
      

      will fail, in the sequence where first the lifecycleManager is destroyed, and then the pcpChannel. We get a failure in FluidIoC.js fluid.clearDistribution line 411:

      23:44:51.844:  FATAL ERROR: Uncaught exception: Cannot read property 'distributions' of null
      TypeError: Cannot read property 'distributions' of null
          at Object.fluid.clearDistribution (E:\Source\gits\gpii\node_modules\universal\node_modules\infusion\src\framework\core\js\FluidIoC.js:411:37)
          at E:\Source\gits\gpii\node_modules\universal\node_modules\infusion\src\framework\core\js\FluidIoC.js:421:19
          at Object.fluid.each (E:\Source\gits\gpii\node_modules\universal\node_modules\infusion\src\framework\core\js\Fluid.js:513:17)
          at Object.fluid.clearDistributions (E:\Source\gits\gpii\node_modules\universal\node_modules\infusion\src\framework\core\js\FluidIoC.js:420:15)
          at that.clearConcreteComponent (E:\Source\gits\gpii\node_modules\universal\node_modules\infusion\src\framework\core\js\FluidIoC.js:1041:19)
          at Object.fluid.each (E:\Source\gits\gpii\node_modules\universal\node_modules\infusion\src\framework\core\js\Fluid.js:513:17)
          at that.clearComponent (E:\Source\gits\gpii\node_modules\universal\node_modules\infusion\src\framework\core\js\FluidIoC.js:1087:23)
          at .destroy (E:\Source\gits\gpii\node_modules\universal\node_modules\infusion\src\framework\core\js\FluidIoC.js:1234:26)
          at Object.fluid.test.noteTest (E:\Source\gits\gpii\node_modules\universal\node_modules\infusion\tests\test-core\utils\js\IoCTestUtils.js:613:18)
      

      In this case, "targetHead" holds the lifecycleManager, which has been destroyed - and we are just in the process of destroying the pcpChannel, which has an "outDistributions" record which holds a reference to it.

        Attachments

          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: