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

afterDestroy event fires too soon

    XMLWordPrintable

    Details

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

      Description

      The framework's "afterDestroy" event should only fire after all user-visible effects accompanying a component's destruction have completed. In the current body of fluid.clearComponent there are several crucial effects which occur after this point -

      i) The deletion of the shadow
      ii) Tidying up the component' IoC resolution scope
      iii) Removing the component from pathToComponent records
      iv) Actually detaching the component from its parent

      Of these, iii) and iv) are fatally mistimed. The workflow we would like is to be able to fire the createOnEvent event for a component from its afterDestroy listener in order to recreate it. This emerged from the work on GPII-580 where we destroy a server from within one of its settingsHandlers. In the following configuration:

                  }, {
                      func: "{loginRequest}.send"
                  }, { // As a result of the exploding settings handler, the attempt to login will destroy the server
                      event: "{configuration}.server.events.afterDestroy",
                      listener: "gpii.tests.journal.logDestroyed",
                      args: "{loginRequest}"
                  },
                  kettle.test.startServerSequence
      

      the startServerSequence if entered synchronously will try to reconstruct the server component - unfortunately it will trigger a fresh "clearComponent" for it whilst the existing one is still in progress since it has not yet been cleared from its parent (iv) during either onDestroy or afterDestroy

        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: