fix: restamp only the deployer's own carried draft

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Guilhem Lemouel
2026-09-08 10:49:35 +02:00
co-authored by Claude Opus 5
parent 98bce2576c
commit fdfbbc2c50
7 changed files with 71 additions and 20 deletions
+5 -2
View File
@@ -2137,8 +2137,10 @@ async fn create_script_internal<'c>(
if p_path != &ns.path {
// Everything left at the old path is a draft this deploy didn't
// consume — teammates' rows, and the deployer's own when the caller
// asked us to keep it (a move re-deploys the DEPLOYED content, not
// the draft). Carry them rather than strand them.
// asked us to keep it. Carry them rather than strand them. Only the
// deployer's own row is restamped: this runs on any path-changing
// deploy, content edits included, and a teammate whose draft claimed
// the new head would lose their stale-draft warning.
let outcome = windmill_common::user_drafts::move_drafts_for_path(
&mut tx,
&w_id,
@@ -2150,6 +2152,7 @@ async fn create_script_internal<'c>(
UserDraftItemKind::Script
.base_version_field()
.map(|f| (f, format!("\"{}\"", hash))),
&authed.email,
)
.await?;
if outcome.left_behind > 0 {