Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1358619 - recipe page reservation tab: after extending the reservation, watchdog time changes 10-20 seconds later
Summary: recipe page reservation tab: after extending the reservation, watchdog time c...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Community
Component: web UI
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
low vote
Target Milestone: 24.4
Assignee: Anwesha Chatterjee
QA Contact: Dan Callaghan
URL:
Whiteboard:
Depends On:
Blocks: 1500142
TreeView+ depends on / blocked
 
Reported: 2016-07-21 07:34 UTC by Dan Callaghan
Modified: 2017-10-10 03:44 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1500142 (view as bug list)
Environment:
Last Closed: 2017-10-03 03:57:36 UTC


Attachments (Terms of Use)

Description Dan Callaghan 2016-07-21 07:34:35 UTC
Description of problem:


Version-Release number of selected component (if applicable):
26715c4 

How reproducible:
somewhat easily

Steps to Reproduce:
1. Go to the recipe page, Reservation tab, for a recipe which is currently reserved
2. Click Extend the reservation
3. Enter 86400 in the modal and Save changes

Actual results:
Button spins for a second, then the modal closes indicating that the reservation was successfully extended (and it was). However the "Remaining watchdog time" countdown still keeps counting down from the old time. After 10-20 seconds (basically on the next Backbone .fetch() call) the countdown timer suddenly updates to the new value.

Expected results:
Remaining watchdog time should be updated when the modal closes, so that I know that it was successfully extended to the right value.

Additional info:
Probably just need to either .listenTo(), or possibly issue an explicit .fetch(), when the extend request has come back and before closing the modal.

Comment 1 Anwesha Chatterjee 2017-08-08 01:25:22 UTC
https://gerrit.beaker-project.org/#/c/5778

Comment 2 Anwesha Chatterjee 2017-08-10 03:42:27 UTC
https://gerrit.beaker-project.org/#/c/5783/

Comment 3 Anwesha Chatterjee 2017-08-10 03:59:20 UTC
The second patch here is to address a different bug in the same area of code that I stumbled upon while testing the bug described here. 

The countdown timer for the watchdog (which is placed in the recipe runtime status view) while counting down, does not set the time_remaining_seconds value to the model. This means that the view has an incorrect representation of the (true) time remaining until the model is next autofetched (which only happens every 30 seconds)

Comment 4 Anwesha Chatterjee 2017-08-10 04:22:57 UTC
So what this means from a user PoV is that when "Extend the Reservation" is clicked, the modal appears to be populated with a different time to the one that appears in the UI, it basically displays the time that was last fetched from the recipe model upon autofetch. So when the user sees a time of (say) 23:59:55, and tries to set it back to (say) 24:00:00, the modal may still display 86400 (i.e. 24:00:00) which is not true. And upon saving changes the view fails to re-render as the backbone view does not get a "changed" event as according to the view, the change does not happen. 

One solution to this is to have the timer set the time to the model as it counts down (it would also help to have the countdown timer in the model rather than restricted to a view).

Comment 6 Dan Callaghan 2017-09-29 09:46:55 UTC
Verified using a recipe in Reserved state.

Click "Extend the reservation", modal is pre-filled with 86369 seconds.
Close modal, click it again. Pre-filled with 86344 seconds.
=> Verified that the modal is using the current watchdog timer counting down.

Fill in 86400 seconds and click "Save Changes". The button spins for a bit, and then when the modal is closed the watchdog time remaining shows 23:59:59.
=> Verified that the time remaining is kept in sync with the extension.

Comment 7 Dan Callaghan 2017-10-03 03:57:36 UTC
Beaker 24.4 has been released.


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