Connect JavaScript API stops working after sorting table column containing macro iframe

XMLWordPrintable

    • Major

      Issue Summary

      The JavaScript API stops working when a macro iframe is placed within a table and the table column is sorted. Initially, the API works as expected on page load; however, after sorting the table column containing the macro, it stops functioning.

      This is the method the button is calling. Which works as expected on page load; but, if we sort the table column that contains the macro, it stops working.
       

      const getUser = () => {
        AP.user.getCurrentUser((user) => {
          console.clear();
          console.warn(`Getting user : ${JSON.stringify(user)}`);
          document.getElementById('innerDiv').innerText = user.atlassianAccountId;
        });
      }; 

      Additionally if we call AP.user.getCurrentUser() in the console after the sort, it returns undefined.

      Steps to Reproduce

      1. Create a Confluence page and add a table with two columns. One column should contain simple text, and the second should contain third-party macros.
      2. Start sorting the column with simple text in page view mode.
      3. Try to call the following API from a macro:
        • AP.user.getCurrentUser(user => console.info(user))

      Expected Results

      Connect JS api should still work even after table sorting. 

      Actual Results

      The issue is that Javascript API doesn’t work anymore if the macro iframe is inside a table and the table column is sorted.

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

              Assignee:
              Unassigned
              Reporter:
              Sherica Ocbania
              Votes:
              10 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: