Uploaded image for project: 'Blossom'
  1. Blossom
  2. BLOSSOM-282

Race condition in the DialogCreationContextHolder or Creator

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 3.4.6
    • 3.4.5
    • None
    • None
    • Yes

      via reopening comment on SUPPORT-13357:

      i think the solution for this topic has some race condition. Maybe a Problem in the DialogCreationContextHolder oder Creator... so i sadly must reopen that issue.

      We are using the following

      @DialogFactory(TestDialog.DIALOG_ID)
      public class TestDialog {
      
         public static final String DIALOG_ID = "myTestDialog";
         private static final Logger LOG = LoggerFactory.getLogger(TestDialog.class);
      
         @TabFactory("buttonLinkDialog.button.tab.label")
         public void buttonLinkTab(Node node, UiConfig uiConfig, TabBuilder tabBuilder) {
            tabBuilder.fields(
                  uiConfig.fields.text("keepitsimple").label("Simple Field"),
                  uiConfig.fields.text("keepitlocalized").label("Locale Field").i18n().required()
            );
      
         }
      
      
         @PostCreate(value = PostCreate.Phase.AFTER_SUB_CLASSES)
         public void postCreateReferenceTab(Node node, DialogBuilder dialogBuilder) {
            LOG.info("Calling postCreateReferenceTab with node {}", NodeUtil.getNodePathIfPossible(node));
         }
      
      } 

      just to print the node path for the node that is passed to the annotated method.
      When i open a page and edit a component using this dialog for the first time everything is fine. Reopening it works as well, but as soon as i have several components within the same page things getting weird.
      Most of the times the first edit of each component is correct. The node passed to the method is the one that is being edited.
      But afterwards the nodes are getting mixed, the passed node to the post create method does no longer fit to the edited node.
      See Screen - i clicked edit on each component and reported the log output for it. The nodes are named as they contain content, see another screen.

        Acceptance criteria

              mgeljic Mikaël Geljić
              mgeljic Mikaël Geljić
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD