Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-81454

HTML Script elements with content of length greater than 4000 characters, are corrupted when rendered within a Macro

      Issue Summary

      HTML Script elements with content of length greater than 4000 characters, are corrupted when rendered within a Macro.

      Steps to Reproduce

      1. Create a plugin
      2. Implement a macro which renders a Velocity file
      3. Embed <script> element in Velocity file
      4. Ensure script element content is greater than 4000 characters
      5. Install plugin
      6. Create a page and add the macro

      Expected Results

      Script executes in browser.

      Actual Results

      Browser throws syntax error as content is split into 4000 character chunks surrounded by <![CDATA[}} and {{]]>.

      Workaround

      Split >4000 character scripts into multiple <4000 character scripts.

      OR

      Type // and add a newline before every 4000th character so the insertion of ]]><![CDATA[ does not corrupt your script.

            [CONFSERVER-81454] HTML Script elements with content of length greater than 4000 characters, are corrupted when rendered within a Macro

            When will this be fixed, our Confiforms is still broken in 8.1.3 - and we are u nable to deploy to production -  

            This is a heavy blocker

            Best Regards,

            Sandi Ameen

            CitiBank

            Sandi Ameen added a comment - When will this be fixed, our Confiforms is still broken in 8.1.3 - and we are u nable to deploy to production -   This is a heavy blocker Best Regards, Sandi Ameen CitiBank

            Oskar Wirth (OWI) added a comment - - edited

            My previous comment was somehow deleted so I try it again.
            Your (Atlassian support) asked me to comment here, after my question could not be answered:

            "I cannot say if we hit the 64k limit. How can I figure out?ā€

            Our problem is, we don’t know what exactly counts towards this limit, we are just a customer. What we do is to wrap tables with stiltsoft macros. TableTransformer, TableExcerpt, TableInclude…
            Does content, enriched with hyperlinks (generated by TableTransformer) count as well?

            Best Regards,
            Oskar

            Oskar Wirth (OWI) added a comment - - edited My previous comment was somehow deleted so I try it again. Your (Atlassian support) asked me to comment here, after my question could not be answered: "I cannot say if we hit the 64k limit. How can I figure out?ā€ Our problem is, we don’t know what exactly counts towards this limit, we are just a customer. What we do is to wrap tables with stiltsoft macros. TableTransformer, TableExcerpt, TableInclude… Does content, enriched with hyperlinks (generated by TableTransformer) count as well? Best Regards, Oskar

            Hi 

            Registered an ECOHELP ticket with a screencast to reproduce the issue

            https://ecosystem.atlassian.net/servicedesk/customer/portal/34/ECOHELP-13901

            Alex

            Alex Medved {ConfiForms} added a comment - Hi  Registered an ECOHELP ticket with a screencast to reproduce the issue https://ecosystem.atlassian.net/servicedesk/customer/portal/34/ECOHELP-13901 Alex

            Hi 6dfd011db329,

            Can you open a ECOHELP ticket with specific steps to reproduce the issue, with versions of your app, Confluence and specific text that reproduces the behaviour so we can reproduce it?

            Thanks,
            James.

            James Richards added a comment - Hi 6dfd011db329 , Can you open a ECOHELP ticket with specific steps to reproduce the issue, with versions of your app, Confluence and specific text that reproduces the behaviour so we can reproduce it? Thanks, James.

            James Ponting added a comment - - edited

            Hey 6dfd011db329,

            This doesn't seem to be the same problem, so we'll need to investigate it further.

            I've asked our Ecosystem team to reach out to you so we can gather some information and look into it.

            Thanks,
            James Ponting
            Engineering Manager - Confluence Data Center

            EDIT:: Turns out we can't do that. Sorry for the confusion, see below

            James Ponting added a comment - - edited Hey 6dfd011db329 , This doesn't seem to be the same problem, so we'll need to investigate it further. I've asked our Ecosystem team to reach out to you so we can gather some information and look into it. Thanks, James Ponting Engineering Manager - Confluence Data Center EDIT:: Turns out we can't do that. Sorry for the confusion, see below

            We have an ongoing incident with one customer, where these CDATA tags were still injected in unexpected places (using Confluence 8.0.3)

            We have analyzed the HTML they have shared with us and indeed, the page is pretty JS heavy, but the 3 largest blocks are

            5243
            12737
            27653

            characters. Certainly under the 64K limit what you have mentioned. And those are not generated by our app - the largest we have is 4053 characters. True that the page has 441 script blocks (as it is an aggregated page that uses data from multiple others)

            Alex 

             

            Alex Medved {ConfiForms} added a comment - - edited We have an ongoing incident with one customer, where these CDATA tags were still injected in unexpected places (using Confluence 8.0.3) We have analyzed the HTML they have shared with us and indeed, the page is pretty JS heavy, but the 3 largest blocks are 5243 12737 27653 characters. Certainly under the 64K limit what you have mentioned. And those are not generated by our app - the largest we have is 4053 characters. True that the page has 441 script blocks (as it is an aggregated page that uses data from multiple others) Alex   

            Hey 6dfd011db329,

            Mostly fixed is an improvement at least.

            The limit applies to the contents of each script element.

            Do you have a finger to the wind idea of how many characters you might need for a given element?

            We can build some wiggle room in on our end.

            Thanks,
            James Ponting
            Engineering Manager - Confluence Data Center

            James Ponting added a comment - Hey 6dfd011db329 , Mostly fixed is an improvement at least. The limit applies to the contents of each script element. Do you have a finger to the wind idea of how many characters you might need for a given element? We can build some wiggle room in on our end. Thanks, James Ponting Engineering Manager - Confluence Data Center

            Hi James

            We have see this "mostly fixed", but still have some customers who are experiencing this issue on large forms they have

             When you say the "merge size" is now 64000 characters, does it mean the contents of a script element should be less than 64000 or is it a limit for all script elements generated by the velocity template? In other words - what do you mean by the "merge size"

            Alex

            Alex Medved {ConfiForms} added a comment - Hi James We have see this "mostly fixed", but still have some customers who are experiencing this issue on large forms they have  When you say the "merge size" is now 64000 characters, does it mean the contents of a script element should be less than 64000 or is it a limit for all script elements generated by the velocity template? In other words - what do you mean by the "merge size" Alex

            James Ponting added a comment - - edited

            Hi All,

            We changed the configured merge size from 4000 characters to 64000 characters.

            f9e6f663a53f, 6dfd011db329 - Are your use cases requiring text values in excess of 64000 characters?

            We want to avoid leaving this configuration unbounded as there are potential memory and stability impacts from this configuration.

            Please let us know

            Thanks,
            James Ponting
            Engineering Manager - Confluence Data Center

            James Ponting added a comment - - edited Hi All, We changed the configured merge size from 4000 characters to 64000 characters. f9e6f663a53f , 6dfd011db329 - Are your use cases requiring text values in excess of 64000 characters? We want to avoid leaving this configuration unbounded as there are potential memory and stability impacts from this configuration. Please let us know Thanks, James Ponting Engineering Manager - Confluence Data Center

            Upgraded to Confluence 8.1.0 yesterday, still have the problem.

            Oskar Wirth (OWI) added a comment - Upgraded to Confluence 8.1.0 yesterday, still have the problem.

              854eef6f5746 Kusal Kithul-Godage
              854eef6f5746 Kusal Kithul-Godage
              Affected customers:
              3 This affects my team
              Watchers:
              16 Start watching this issue

                Created:
                Updated:
                Resolved: