Project

General

Profile

Bug #17347

Task auto-reload function leaks to other pages

Added by Adam Ruzicka almost 2 years ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
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

Related to foreman-tasks - Bug #17346: Clicking the Dynflow console button should stop auto reloading.New2016-11-15

Associated revisions

Revision c1284725 (diff)
Added by Adam Ruzicka over 1 year ago

Fixes #17347 - Stop autorefresh leaking to other pages

History

#1 Updated by Adam Ruzicka almost 2 years ago

  • Target version set to 113

#2 Updated by Adam Ruzicka almost 2 years ago

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

#3 Updated by The Foreman Bot over 1 year 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

#4 Updated by Adam Ruzicka over 1 year ago

  • Target version changed from 113 to 1.14.1

#5 Updated by Ivan Necas over 1 year ago

  • Status changed from Ready For Testing to Closed
  • Legacy Backlogs Release (now unused) set to 261

Also available in: Atom PDF