Problem/Motivation
Follow-up to #3227122: Create a lock system to ensure only 1 update can be attempted at a time
Here is example of the problem that could happen.
- It's Tuesday and there is release coming on Wednesday.
- The site is on 9.3.0 but on Tuesday the latest version 9.3.1
- The site admin on Tuesday morning doesn't know what time the release is coming
- admin logs into site at 9am, sees the update 9.3.1(which could be security release also) and starts the updates
- The site admin makes it to the confirmation page so the update is not applied yet
- The admin has other tasks so goes away for a bit.
- The admin hears at 11am that new release which is actually 9.3.2 has just dropped.
- The admin opens a new tab to start the update to 9.3.2
- The admin sees an existing update(the 1 the admin started) and breaks the stage lock
- The admin gets to the confirmation page for 9.3.2 but does not apply
- The admin researches 9.3.2 release and realizes there is conflict when one their contrib modules and decide they actually should just update to 9.3.1 for now
- Now the admin has 2 tabs, one for 9.3.1. and another for 9.3.2
- The admin goes back to the 9.3.1 tab(which eventually will a message displaying the 9.3.1 version, needs follow-up) to continue the update(lets assume they fully understand what breaking the lock did)
- The admin confirms the update to apply the site.
- The admin thinks they updated 9.3.1😃
- The admin actually updated to 9.3.2 😿 because that was the current stage and they were the owner of that stage
right now this could happen now. It would be worse if this module or another actually gave the user a choice of all updates that were secure and didn't choose 1 for them. This would mean with the 2 tab scenario we would update a different one then what they choose.
further instead of 2 auto-updates the same problem where the 2nd stage operation in the confirmation state could be a Project Browser install. Going back to the first tab which would be a auto-updates tab would actually install the Project Browser selected projects.
Steps to reproduce
Proposed resolution
Return a unique stage-id from create()
and add a new reclaimStage($unique)
method that must be called before any other operations if create()
was not called in the current request.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork automatic_updates-3250386
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
tedbowComment #3
tedbowComment #4
tedbowComment #6
tedbowI still need to update the UpdateReady form to save the stage id was passed in the URL and send it on to the batch operations.
Comment #8
phenaproximaComment #9
phenaproximaComment #10
tedbowLooks good!
Comment #11
phenaproximaComment #12
phenaproxima