From 943789533dc71004757abb1fb421c2b8bc148f16 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Fri, 4 Sep 2026 15:40:51 +0200 Subject: [PATCH 1/2] chore: pin ee-repo-ref; the guest cookie is never cleared by a callback Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01BayTppRCstWX6qTf3LMco5 --- backend/ee-repo-ref.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/ee-repo-ref.txt b/backend/ee-repo-ref.txt index efe9db1b2e..3fe209f1e4 100644 --- a/backend/ee-repo-ref.txt +++ b/backend/ee-repo-ref.txt @@ -1 +1 @@ -00bf1dde9c396382a2db30ff7a5f1703c2611304 \ No newline at end of file +32841072aa396bff91d30bd91854fa348cb3c439 \ No newline at end of file From 6081e286c969da11aadf887d46b7c5b6553bde08 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Fri, 4 Sep 2026 15:50:41 +0200 Subject: [PATCH 2/2] docs: the workspace-scoped guest_activity delete moves an instance-wide count; assert the mint records the guest Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01BayTppRCstWX6qTf3LMco5 --- backend/tests/app_guest_allowance.rs | 11 +++++++++++ .../windmill-api-workspaces/src/workspaces_extra.rs | 2 ++ 2 files changed, 13 insertions(+) diff --git a/backend/tests/app_guest_allowance.rs b/backend/tests/app_guest_allowance.rs index 9642941893..5da74961e6 100644 --- a/backend/tests/app_guest_allowance.rs +++ b/backend/tests/app_guest_allowance.rs @@ -94,6 +94,17 @@ async fn the_allowance_caps_strangers_and_meters_an_enterprise_plan( mint(&db, "g1@example.com") .await .expect("a guest already in the window is let back in"); + let recorded: bool = sqlx::query_scalar( + "SELECT EXISTS(SELECT 1 FROM guest_activity + WHERE email = 'g1@example.com' AND workspace_id = 'test-workspace' + AND day = CURRENT_DATE AND last_seen_at > now() - interval '1 minute')", + ) + .fetch_one(&db) + .await?; + assert!( + recorded, + "the mint writes the guest_activity row the allowance is counted on" + ); let list: serde_json::Value = authed( client().get(format!( diff --git a/backend/windmill-api-workspaces/src/workspaces_extra.rs b/backend/windmill-api-workspaces/src/workspaces_extra.rs index f451138859..dfb6e49921 100644 --- a/backend/windmill-api-workspaces/src/workspaces_extra.rs +++ b/backend/windmill-api-workspaces/src/workspaces_extra.rs @@ -1119,6 +1119,8 @@ pub(crate) async fn delete_workspace( .execute(&mut *tx) .await?; + // Unlike the rest of this list, this also moves an instance-wide figure: the guest + // allowance and the seats past it are counted over every workspace's rows. sqlx::query("DELETE FROM guest_activity WHERE workspace_id = $1") .bind(&w_id) .execute(&mut *tx)