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

table.sortable may be null in a ProgressiveRendering callback

      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.

          [JENKINS-18119] table.sortable may be null in a ProgressiveRendering callback

          Code changed in jenkins
          User: Jesse Glick
          Path:
          changelog.html
          core/src/main/java/jenkins/util/ProgressiveRendering.java
          core/src/main/resources/hudson/model/View/AsynchPeople/index.jelly
          http://jenkins-ci.org/commit/jenkins/315bde60d0618c0b17ffeab3f812adce3586c3da
          Log:
          [FIXED JENKINS-18119] Work around timing issue in sortable object.
          Note that when workaround is active, table will not get sorted properly.
          Probably OK since tables with large contents that need sorting probably take longer to finish rendering.

          Compare: https://github.com/jenkinsci/jenkins/compare/94a3b43d4a48...315bde60d061

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html core/src/main/java/jenkins/util/ProgressiveRendering.java core/src/main/resources/hudson/model/View/AsynchPeople/index.jelly http://jenkins-ci.org/commit/jenkins/315bde60d0618c0b17ffeab3f812adce3586c3da Log: [FIXED JENKINS-18119] Work around timing issue in sortable object. Note that when workaround is active, table will not get sorted properly. Probably OK since tables with large contents that need sorting probably take longer to finish rendering. Compare: https://github.com/jenkinsci/jenkins/compare/94a3b43d4a48...315bde60d061

          dogfood added a comment -

          Integrated in jenkins_main_trunk #2553
          [FIXED JENKINS-18119] Work around timing issue in sortable object. (Revision 315bde60d0618c0b17ffeab3f812adce3586c3da)

          Result = SUCCESS
          Jesse Glick : 315bde60d0618c0b17ffeab3f812adce3586c3da
          Files :

          • core/src/main/java/jenkins/util/ProgressiveRendering.java
          • core/src/main/resources/hudson/model/View/AsynchPeople/index.jelly
          • changelog.html

          dogfood added a comment - Integrated in jenkins_main_trunk #2553 [FIXED JENKINS-18119] Work around timing issue in sortable object. (Revision 315bde60d0618c0b17ffeab3f812adce3586c3da) Result = SUCCESS Jesse Glick : 315bde60d0618c0b17ffeab3f812adce3586c3da Files : core/src/main/java/jenkins/util/ProgressiveRendering.java core/src/main/resources/hudson/model/View/AsynchPeople/index.jelly changelog.html

          Jesse Glick added a comment -

          Workaround is not really possible for plugins such as cloudbees-plugin-usage unless they have separate versions for 1.513+ vs. 1.512-, which is undesirable. This is a serious backward compatibility issue.

          Jesse Glick added a comment - Workaround is not really possible for plugins such as cloudbees-plugin-usage unless they have separate versions for 1.513+ vs. 1.512-, which is undesirable. This is a serious backward compatibility issue.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          changelog.html
          core/src/main/java/jenkins/util/ProgressiveRendering.java
          core/src/main/resources/hudson/model/View/AsynchPeople/index.jelly
          war/src/main/webapp/scripts/sortable.js
          http://jenkins-ci.org/commit/jenkins/aae1dc3164b94565d2676edbe68a6daec9c62817
          Log:
          [FIXED JENKINS-18119] More compatible fix: make ts_refresh work again.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html core/src/main/java/jenkins/util/ProgressiveRendering.java core/src/main/resources/hudson/model/View/AsynchPeople/index.jelly war/src/main/webapp/scripts/sortable.js http://jenkins-ci.org/commit/jenkins/aae1dc3164b94565d2676edbe68a6daec9c62817 Log: [FIXED JENKINS-18119] More compatible fix: make ts_refresh work again.

          dogfood added a comment -

          Integrated in jenkins_main_trunk #2760
          [FIXED JENKINS-18119] More compatible fix: make ts_refresh work again. (Revision aae1dc3164b94565d2676edbe68a6daec9c62817)

          Result = UNSTABLE
          Jesse Glick : aae1dc3164b94565d2676edbe68a6daec9c62817
          Files :

          • changelog.html
          • war/src/main/webapp/scripts/sortable.js
          • core/src/main/resources/hudson/model/View/AsynchPeople/index.jelly
          • core/src/main/java/jenkins/util/ProgressiveRendering.java

          dogfood added a comment - Integrated in jenkins_main_trunk #2760 [FIXED JENKINS-18119] More compatible fix: make ts_refresh work again. (Revision aae1dc3164b94565d2676edbe68a6daec9c62817) Result = UNSTABLE Jesse Glick : aae1dc3164b94565d2676edbe68a6daec9c62817 Files : changelog.html war/src/main/webapp/scripts/sortable.js core/src/main/resources/hudson/model/View/AsynchPeople/index.jelly core/src/main/java/jenkins/util/ProgressiveRendering.java

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

              Created:
              Updated:
              Resolved: