mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-14 00:02:55 +00:00
* fix: let a principal without a login account own a draft Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018Lu3hExEDPZu2dAEhZDVAi * fix: keep an accountless draft owner from colliding or reading as legacy Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018Lu3hExEDPZu2dAEhZDVAi * fix: drop the unnameable draft owner everywhere and guard the no-op rename Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018Lu3hExEDPZu2dAEhZDVAi * fix: drop the unused Acquire import in the draft rename test Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018Lu3hExEDPZu2dAEhZDVAi * docs: drop the stale draft_users claim from the fork-clone rationale Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018Lu3hExEDPZu2dAEhZDVAi * chore: update ee-repo-ref to f5b783d2f7608e1ff3a817caa8b719e06f8b8981 This commit updates the EE repository reference after PR #768 was merged in windmill-ee-private. Previous ee-repo-ref: f3dba016e9274ee9bbe46b4f070d3ed29843e5fd New ee-repo-ref: f5b783d2f7608e1ff3a817caa8b719e06f8b8981 Automated by sync-ee-ref workflow. --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>
29 lines
1.1 KiB
Rust
29 lines
1.1 KiB
Rust
use sqlx::{Pool, Postgres};
|
|
use windmill_common::user_drafts::rename_drafts_of_email;
|
|
|
|
/// A rename onto the same address has to be a no-op: the helper clears a draft the destination
|
|
/// already holds at the same item, and every row would be its own destination. SCIM PATCH sends
|
|
/// `userName` unconditionally, so an IdP re-sending an unchanged one reaches this.
|
|
#[sqlx::test(migrations = "../migrations", fixtures("base"))]
|
|
async fn renaming_onto_the_same_address_keeps_the_drafts(db: Pool<Postgres>) {
|
|
sqlx::query(
|
|
"INSERT INTO draft(workspace_id, path, typ, value, email) \
|
|
VALUES ('test-workspace', 'u/test-user/s', 'script', '{}'::json, 'test@windmill.dev')",
|
|
)
|
|
.execute(&db)
|
|
.await
|
|
.expect("failed to seed draft");
|
|
|
|
let mut conn = db.acquire().await.unwrap();
|
|
rename_drafts_of_email(&mut conn, "test@windmill.dev", "test@windmill.dev")
|
|
.await
|
|
.unwrap();
|
|
|
|
let kept: i64 =
|
|
sqlx::query_scalar("SELECT COUNT(*) FROM draft WHERE email = 'test@windmill.dev'")
|
|
.fetch_one(&db)
|
|
.await
|
|
.unwrap();
|
|
assert_eq!(kept, 1);
|
|
}
|