Project

General

Profile

Actions

Bug #17347

closed

Task auto-reload function leaks to other pages

Added by Adam Ruzicka over 7 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

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;
            two_pane_open(currentTwoPaneTask);
          } else {
            taskProgressReloader.stop();
          }
        } else {
          document.location.reload();
        }
      },

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:
always

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 1 (1 open0 closed)

Related to foreman-tasks - Bug #17346: Clicking the Dynflow console button should stop auto reloading.New11/15/2016Actions
Actions #1

Updated by Adam Ruzicka over 7 years ago

  • Target version set to 113
Actions #2

Updated by Adam Ruzicka over 7 years ago

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

Updated by The Foreman Bot almost 7 years ago

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

Updated by Adam Ruzicka almost 7 years ago

  • Target version changed from 113 to 1.14.1
Actions #5

Updated by Ivan Necas almost 7 years ago

  • Status changed from Ready For Testing to Closed
  • translation missing: en.field_release set to 261
Actions

Also available in: Atom PDF