Default macro editor rendered the first time instead of custom editor

Hi devs,

Wondering if you could try explain the phenomenon we’re seeing. We first noticed this issue in failing(very rare) E2E test and recently in our customer interview calls.

Our macro has a custom editor configured with its editor.url specified correctly in the descriptor.
Most of the time, when our macro is inserted or edited on a Confluence page, the custom macro editor will render as expected.

However, once in a blue moon (caught by E2E tests and recently customer demo sessions), the default macro editor (with large bezel & preview section) is rendered.

As developers of the app and product folks who are aware that that’s not what it should be, would close the editor before opening it again. And this time, the custom macro editor (correct editor) would render as intended.

The expected editor would render correctly on subsequent calls after that. We’re not sure how to reproduce this and trying to understand why this happened.

You can see how this rare scenario might impact new customers (lucky few) when trying out our app the first time. So far, there’s been only 2 incidents with customers where we saw this happened.

Here’s the custom macro editor configuration in our descriptor

editor: {
    url: '/editor/live-template',
    editTitle: {
      value: 'Edit Live Template Macro',
    },
    insertTitle: {
      value: 'Insert Live Template Macro',
    },
    width: '865px',
    height: '450px',
  },
  parameters: [
    {
      identifier: 'templateType',
      name: {
        value: 'Type',
      },
      description: {
        value: 'The type of page template to import and render.',
      },
      type: 'string',
      required: true,
    },
    {
      identifier: 'templateId',
      name: {
        value: 'Template',
      },
      description: {
        value:
          'The name of the page template to import and render. e.g. SPACE:TITLE',
      },
      type: 'string',
      required: true,
    },
    {
      identifier: 'templateOption',
      name: {
        value: 'Template Option',
      },
      description: {
        value: 'The template option saved to be rendered during editing.',
      },
      type: 'string',
      required: true,
      hidden: true,
    },
    {
      identifier: 'templateTypeOption',
      name: {
        value: 'Template Type Option',
      },
      description: {
        value: 'The template type option saved to be rendered during editing.',
      },
      type: 'string',
      required: true,
      hidden: true,
    },
    {
      identifier: 'type',
      name: {
        value: '(Legacy) Type',
      },
      description: {
        value: 'Migrated template type.',
      },
      type: 'string',
      required: false,
      hidden: true,
    },
    {
      identifier: 'template',
      name: {
        value: '(Legacy) Template name',
      },
      description: {
        value: 'Migrated template name.',
      },
      type: 'string',
      required: false,
      hidden: true,
    },
  ]

Appreciate if some of you’ve experienced this to share some insights and if there anything we can do on our end to prevent this from happening.

8 Likes

Hi @ucchishta.sivaguru ,

I’m not sure what’s going on here, but it seems like there is a race condition given that it intermittently occurs in end to end tests.

@PeterObara , what the best way forward here?

Regards,
Dugald

2 Likes

@ucchishta.sivaguru , @PeterObara ,

Further to the above, I’ve create a minimal Confluence Connect that provides a dynamic content macro with a custom editor and a single parameter. I haven’t seen the problem reproduced with it, but could either of you use it to see if you can reproduce the issue using an E2E testing harness? Here are some details about the app:

Regards,
Dugald

4 Likes

Appreciate the sample connect app @dmorrow.
I installed it in one of our dev instance and did some E2E runs with cypress and it seems that I was able to reproduce the issue on the first run, and briefly for the second run (before the custom editor replaces the default editor out of nowhere). Third run onwards - I see the custom editor.

Attaching a loom recording of the test runs:

1 Like

Hi @ucchishta.sivaguru ,

Thanks for doing this - it helps a lot. I’ve created [CONFCLOUD-72365] Custom dynamic content macro editor not reliably shown - Create and track feature requests for Atlassian products. for the Confluence Cloud Ecosystem team to fix.

Regards,
Dugald

2 Likes

@dmorrow

No problem, and thank you again.

1 Like