Bug #17347

Task auto-reload function leaks to other pages

Added by Adam Ruzicka over 1 year ago. Updated about 1 year ago.

Assigned To:Adam Ruzicka
Target version:Foreman - Team Ivan Iteration 16
Difficulty: Bugzilla link:1343539
Found in release: Pull request:https://github.com/theforeman/foreman-tasks/pull/257
Story points-
Velocity based estimate-
Releaseforeman-tasks-0.9.3Release relationshipAuto


Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1343539

Description of problem:

if (typeof taskProgressReloader === 'undefined') {
    var taskProgressReloader = {
      timeoutId: null,
      reload: function () {
        // we need different reload mechanism for two-pane and non-two-pane
        if (typeof currentTwoPaneTask !== 'undefined') {
>>>       if($('.two-pane-right').length) {
            taskProgressReloader.timeoutId = null;
          } else {
        } else {

If you have a running task with auto-reload set to True, it will refresh the '.two-pane-right' element every 5 seconds if it exists in the DOM.

However, if you manage to navigate to e.g. Infrastructure -> Domains -> Domain_ID, you'll open another dialog with the same class.
Since the navigation is handled by javascript, no DOM refresh occurs, keeping the auto refresh function running. This detects the `.two-pane-right` element and refreshes it with the task details.

User ends up with a task details dialog at Domains page (see screenshot).

Version-Release number of selected component (if applicable):
6.2.0 beta (GA14.2)

How reproducible:

Steps to Reproduce:
1. create some long-running task (e.g. sync some red hat repos)
2. open up the task details via Monitor -> Tasks
3. leave auto-refreshing on
4. just after the refresh, navigate to some entity using the same css class (e.g. Infrastructure->Domains->yourDomain)
5. after a short while (<5seconds) the domain details should bre refreshed and display the task details

Actual results:
taskProgressReloader is not being stopped as it still detects the .two-pane-right element.

Expected results:
taskProgressReloader stops on navigating out of the page. the condition should look for some unique selector instead of a class shared all across satellite (.two-pane-right)

Additional info:

Related issues

Related to foreman-tasks - Bug #17346: Clicking the Dynflow console button should stop auto relo... New 11/15/2016

Associated revisions

Revision c1284725
Added by Adam Ruzicka about 1 year ago

Fixes #17347 - Stop autorefresh leaking to other pages


#1 Updated by Adam Ruzicka over 1 year ago

  • Target version set to Team Ivan backlog

#2 Updated by Adam Ruzicka over 1 year ago

  • Related to Bug #17346: Clicking the Dynflow console button should stop auto reloading. added

#3 Updated by The Foreman Bot about 1 year ago

  • Status changed from New to Ready For Testing
  • Assigned To set to Adam Ruzicka
  • Pull request https://github.com/theforeman/foreman-tasks/pull/257 added

#4 Updated by Adam Ruzicka about 1 year ago

  • Target version changed from Team Ivan backlog to Team Ivan Iteration 16

#5 Updated by Ivan Necas about 1 year ago

  • Status changed from Ready For Testing to Closed
  • Release set to foreman-tasks-0.9.3

Also available in: Atom PDF