Projects: restore store-owned fields under the store lock on save (PR re-review)
update_project restored marketplace installs (and status, container id, flags) from a copy read before validation, then wrote the whole record later, so an install landing in between was lost. ProjectsStore gains update_restoring, which runs restore_store_owned_fields against the record as stored under the lock, and update_project writes through it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1112,7 +1112,14 @@ pub async fn update_project(
|
||||
// for every already-running container at launch. The version of this that
|
||||
// re-asserted on every save is what turned a stale flag in a payload into a
|
||||
// restarted bridge.
|
||||
state.projects_store.update(project)
|
||||
//
|
||||
// The restore above served the validation; it is redone under the store's
|
||||
// lock against the record as it is *now*, so a marketplace install, a
|
||||
// status change or a container id landing since `stored` was read is kept
|
||||
// rather than written over.
|
||||
state
|
||||
.projects_store
|
||||
.update_restoring(project, restore_store_owned_fields)
|
||||
}
|
||||
|
||||
/// Restore onto `project` the fields whose value belongs to the store rather
|
||||
|
||||
Reference in New Issue
Block a user