Concurrent-edit protection on app deployment page (optimistic locking) #147
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Surfaced during brainstorming of the unified app deployment page (spec:
docs/superpowers/specs/2026-04-22-app-deployment-page-design.md).The new deployment page lets multiple users (OPERATOR/ADMIN) stage JAR + monitoring/resources/variables/sensitive-keys changes, then hit Save → Redeploy. Two users on the same
(app, environment)at once currently have no protection: last write wins, silently clobbering the other user's staged state.This was deliberately deferred out of the v1 spec — acceptable risk for initial rollout — but should be addressed before this surface sees production use with more than one OPERATOR active.
Proposal
Optimistic locking via
If-Match/ETagusingapp.updated_at(or a dedicatedconfig_versioncounter):GET /api/v1/environments/{env}/apps/{slug}returnsETag: "<updated_at_millis>".PUT /api/v1/environments/{env}/apps/{slug}/config?environment=...(staged writes) requiresIf-Match: "<updated_at_millis>".412 Precondition Failedwith a body describing whose write won.Container config writes (
PUT /apps/{slug}/container-config) and JAR uploads (POST /apps/{slug}/versions) should participate as well.Not in scope
Acceptance criteria
References
ApplicationConfigControllerfor config writes.app.updatedAtcolumn already used for dirty-state detection in the current UI.