Bug 1343539 - Task auto-reload function leaks to other pages
Summary: Task auto-reload function leaks to other pages
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Tasks Plugin
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: Adam Ruzicka
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-06-07 12:36 UTC by Roman Plevka
Modified: 2019-09-26 18:41 UTC (History)
5 users (show)

Fixed In Version: tfm-rubygem-foreman-tasks-0.9.3
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-21 16:49:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
task progress on domains page (73.61 KB, image/png)
2016-06-07 12:37 UTC, Roman Plevka
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 17347 0 None None None 2016-11-15 14:31:50 UTC

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


Note You need to log in before you can comment on or make changes to this bug.