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

Error received when an ajax call back sets a model value on a component that has been destroyed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.1
    • Fix Version/s: 3.0
    • Component/s: IoC Testing Framework
    • Labels:
      None
    • Environment:
      Firefox, Chrome. Didn't test with Safari and IE

      Description

      This issue can be re-produced by running the unit test - https://github.com/cindyli/universal/blob/GPII-1245-demoFLUID5834/gpii/node_modules/gpii-oauth2/gpii-oauth2-authz-server/webTests/components/privacySettings/html/PrivacySettingsWithPrefs-test.html

      The test fails with the error:
      ASSERTION FAILED: Cannot resolve reference

      {arguments}

      .0 from component

      { typeName: "gpii.oauth2.editPrivacySettings" gradeNames: ["gpii.oauth2.editPrivacySettings","gpii.oauth2.privacySettingsDialog","fluid.rendererRelayComponent","fluid.commonRendererComponent","fluid.viewRelayComponent","fluid.commonViewComponent","fluid.standardRelayComponent","fluid.modelRelayComponent","fluid.commonModelComponent"] id: 7hpazkn5-307}

      which has been destroyed

      The cause was because a couple of ajax calls set model values in their call back functions to the component, such as here: https://github.com/cindyli/universal/blob/GPII-1245-demoFLUID5834/gpii/node_modules/gpii-oauth2/gpii-oauth2-authz-server/public/src/components/privacySettings/js/PrivacySettingsDialog.js. However, at then, the component itself has been destroyed by the IoC testing framework.

      The work around is to use fluid.isDestroyed() to check the existence of the component before setting model values.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: