Description of problem:
Version-Release number of selected component (if applicable):
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
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.
Remaining watchdog time should be updated when the modal closes, so that I know that it was successfully extended to the right value.
Probably just need to either .listenTo(), or possibly issue an explicit .fetch(), when the extend request has come back and before closing the modal.
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)
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).
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.
Beaker 24.4 has been released.