Bug 1343539

Summary: Task auto-reload function leaks to other pages
Product: Red Hat Satellite Reporter: Roman Plevka <rplevka>
Component: Tasks PluginAssignee: Adam Ruzicka <aruzicka>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: aruzicka, bbuckingham, bkearney, ehelms, inecas
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-foreman-tasks-0.9.3 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:49:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
task progress on domains page none

Description Roman Plevka 2016-06-07 12:36:28 UTC
Description of problem:

<pre>
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();
        }
      },
</pre>

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:

Comment 1 Roman Plevka 2016-06-07 12:37:18 UTC
Created attachment 1165608 [details]
task progress on domains page

Comment 3 Adam Ruzicka 2016-11-15 14:31:48 UTC
Created redmine issue http://projects.theforeman.org/issues/17347 from this bug

Comment 4 Satellite Program 2017-06-12 12:20:20 UTC
Upstream bug assigned to aruzicka

Comment 5 Satellite Program 2017-06-12 12:20:24 UTC
Upstream bug assigned to aruzicka

Comment 6 Satellite Program 2017-06-21 12:16:10 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/17347 has been resolved.

Comment 8 Roman Plevka 2017-08-03 15:58:13 UTC
VERIFIED
on sat6.3.0-16

The issue no longer ocurs

Comment 9 Satellite Program 2018-02-21 16:49:54 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.

For information on the advisory, and where to find the updated files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:0336