Max size of macro body returned by AP.confluence.getMacroBody()

We have a Connect app that is a dynamic content macro (with a plain text body type, if that matters).

Users can supply content needed by the macro either in the macro body, or by specifying a URL to fetch the content from.

When content is supplied in the macro body, we use the AP.confluence.getMacroBody() jsapi method to retrieve it.

Recently we have had two customers report that they were getting the error “Failed to get macro details”, and in both cases we found that the size of the body content was extremely large (over 1MB).

Has Atlassian published anywhere the maximum size that is supported in the body of a macro (or, the max size supported by the getMacroBody() function?

We would like to add some additional validation into our custom macro editor to warn users if they are likely to hit the size limit, but we’re not sure exactly what that limit is.

Hoping someone can point us in the right direction.

1 Like

Hi Team,

We had a look at this and cached macros don’t have an iframe as such, but work with a

tag that puts the macro body in a data-macro-body attribute. It doesn’t use AP.confluence.getMacroBody().

In the HTML specification, there’s no limit to the size these can be. In my testing I couldn’t break the page so this seems to be specific to the user and their environment.

So the lesson is, don’t store huge amounts of data in cached macros.

James.

1 Like