Bug #17347

Task auto-reload function leaks to other pages

Added by Adam Ruzicka 5 months ago. Updated 5 months ago.

Status:New
Priority:Normal
Assigned To:-
Category:-
Target version:Foreman - Team Ivan backlog
Difficulty: Bugzilla link:1343539
Found in release: Pull request:
Story points-
Velocity based estimate-

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 relo... New 11/15/2016

History

#1 Updated by Adam Ruzicka 5 months ago

  • Target version set to Team Ivan backlog

#2 Updated by Adam Ruzicka 5 months ago

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

Also available in: Atom PDF