Uploaded image for project: 'Confluence Cloud'
  1. Confluence Cloud
  2. CONFCLOUD-60559

Confluence includes jQuery as web resource and overwriting our add-on's version of jQuery

XMLWordPrintable

      The recent Confluence upgrade that occurred on or about a couple of hours before 21 Feb 2017, 4:42:41 AM ET broke on add-on. We immediately started getting Javascript errors on functions where we had extended jQuery. We noticed it hitting our first 2 instances in the IST time zone just after the update window and then later rolled into our ET instance noted above.

      We noticed with the latest upgrade that the web resources being loaded included an older version of jQuery (1.7.2) than what we were including in our add-on (1.8.3). Once the web resources were loaded all of our functions we added to jQuery and all of our event handlers added before the load were missing because basically it's a new version of jQuery being loaded on in the iframe.

      Through a series of console logs we determined that our add-on starts out using jQuery 1.8.3 where we extend and add event handlers. Dumping the jQuery events we confirmed they were added fine. Both the jQuery reference and the $ reference referred to the same jQuery 1.8.3 version.

      Our add-on then loads the web resources. This ends up loading jQuery 1.7.2. After loading the web resources there is a period of time where the jQuery() reference refers to 1.7.2 and the $ reference refers to 1.8.3. At this point our handlers are available in $ but not in jQuery(). At some point in time after the web resource is fully loaded and executed both $ and jQuery() refer to 1.7.2.

      We thought about possibly skipping the loading of jQuery as part of the web resources but noticed that is says "Modified by Atlassian" in the header.

              dtaylor David Taylor (Inactive)
              jeffpierce jeffpierce
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: