Bug #17347
closedTask auto-reload function leaks to other pages
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>Domains->yourDomain)
3. leave auto-refreshing on
4. just after the refresh, navigate to some entity using the same css class (e.g. Infrastructure
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:
Updated by Adam Ruzicka about 8 years ago
- Related to Bug #17346: Clicking the Dynflow console button should stop auto reloading. added
Updated by The Foreman Bot over 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
Updated by Adam Ruzicka over 7 years ago
- Target version changed from 113 to 1.14.1
Updated by Ivan Necas over 7 years ago
- Status changed from Ready For Testing to Closed
- Translation missing: en.field_release set to 261