Uploaded image for project: 'GPII - Global Public Inclusive Infrastructure'
  1. GPII - Global Public Inclusive Infrastructure
  2. GPII-4250

DefaultSettingsLoader workflow modifies FlowManager options after construction

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: FlowManager
    • Labels:
      None

      Description

      The following code at https://github.com/GPII/universal/blob/master/gpii/node_modules/flowManager/src/FlowManager.js#L235 modifies the FlowManager's options after it has constructed:

              "onCreate.loadDefaultSettings": {
                  funcName: "fluid.set",
                  args: ["{that}", ["options", "defaultSettings"], "@expand:{defaultSettingsLoader}.get()"]
              },
      

      Since we are now trying to push the https://issues.fluidproject.org/browse/FLUID-6145 version of Infusion through our stack, this code now triggers an error.
      In fact, the problem represents a real race condition since there is no attempt to synchronise this action with the "onCreate.convertDefaultSettingsToSnapshot" listener written on the next line - although this attempts to force the evaluation of "{that}.options.defaultSettings", the "set" listener on the previous line is not part of this workflow and may well execute out of order.
      The new framework supplies a better route for such issues via the new "resourceLoader" but in the time being we should try to patch up this problem by rewriting the problematic listener as an expander - I notice that the DefaultSettingsLoader executes synchronously so this ought to be possible.

      Note that there are two further sites of options modification on the following lines 282 and 284 of FlowManager.js which also need to be removed:

                  that.options.defaultLifecycleInstructions = gpii.transformer.configurationToSettings(payload.matchMakerOutput.inferredConfiguration[activePrefsSetName], payload.solutionsRegistryEntries);
                  // convert lifecycle instructions to snapshots
                  that.options.defaultSnapshot = fluid.transform(that.options.defaultLifecycleInstructions, function (handlerResponse) {
                      return gpii.settingsHandlers.settingsPayloadToChanges(handlerResponse);
      

        Attachments

          Activity

            People

            Assignee:
            cli@ocad.ca Cindy Qi Li
            Reporter:
            amb26 Antranig Basman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: