Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-18119

table.sortable may be null in a ProgressiveRendering callback

XMLWordPrintable

      Turn Jenkins security on and create a single user and log in. Now start reloading /asynchPeople over and over. Sometimes it is fine; other times the progress bar is broken and the browser console shows an error:

      Uncaught TypeError: Cannot call method 'refresh' of undefined @localhost:78
      display @localhost:78
      checkNews @progressiveRendering.js:29
      

      The TABLE.sortable rule defined the sortable property on a table, yet this might be after the first rendering callback, if that is quick enough.

      https://github.com/jenkinsci/jenkins/commit/8bcc07326d26ad4f2e9b826d2b05a67e97acd3e5#L0L183 seems to have caused this regression. Previously, it was guaranteed that ts_refresh was defined, and if ts_makeSortable had not been called, then no real harm was done. Now the sortable member might be null, so the code in the AsynchPeople view as of ac7e277—and the recommendation in ProgressiveRendering Javadoc—is unsafe.

            Unassigned Unassigned
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: