From f18ddfbe50904016bec326e98b9b187421945b91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Thu, 27 Aug 2026 05:18:30 +0300 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20ulid=20replace?= =?UTF-8?q?s=20uuid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.lock | 14 ++++- Cargo.toml | 2 +- crates/izlek-core/Cargo.toml | 4 +- crates/izlek-core/src/config.rs | 6 +-- crates/izlek-core/src/store/secret.rs | 6 +-- crates/izlek-core/src/store/turso_store.rs | 62 +++++++++++----------- crates/izlek-core/tests/store.rs | 38 ++++++------- crates/izlek-web/Cargo.toml | 2 +- crates/izlek-web/tests/http.rs | 10 ++-- 9 files changed, 77 insertions(+), 67 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4e1cb2e..7662690 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1745,7 +1745,7 @@ dependencies = [ "tokio", "toml", "turso", - "uuid", + "ulid", ] [[package]] @@ -1763,7 +1763,7 @@ dependencies = [ "time", "tokio", "topcoat", - "uuid", + "ulid", ] [[package]] @@ -4165,6 +4165,16 @@ dependencies = [ "syn 3.0.4", ] +[[package]] +name = "ulid" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "470dbf6591da1b39d43c14523b2b469c86879a53e8b758c8e090a470fe7b1fbe" +dependencies = [ + "rand 0.9.5", + "web-time", +] + [[package]] name = "uncased" version = "0.9.10" diff --git a/Cargo.toml b/Cargo.toml index ca12a3c..ab6bdc5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ izlek-core = { path = "crates/izlek-core", default-features = false } serde = { version = "1.0.229", features = ["derive"] } serde_json = "1.0.145" thiserror = "2.0.20" -uuid = { version = "1.25.0", features = ["v4", "serde"] } +ulid = "1" time = { version = "0.3.55", features = ["serde", "formatting", "parsing", "macros"] } tokio = { version = "1.53.1", features = ["full"] } turso = "=0.8.0-pre.7" diff --git a/crates/izlek-core/Cargo.toml b/crates/izlek-core/Cargo.toml index dbe4f34..4d6e062 100644 --- a/crates/izlek-core/Cargo.toml +++ b/crates/izlek-core/Cargo.toml @@ -21,7 +21,7 @@ server = [ "dep:subtle", "dep:tokio", "dep:turso", - "dep:uuid", + "dep:ulid", ] [dependencies] @@ -39,7 +39,7 @@ time.workspace = true toml.workspace = true tokio = { workspace = true, optional = true } turso = { workspace = true, optional = true } -uuid = { workspace = true, optional = true } +ulid = { workspace = true, optional = true } [dev-dependencies] async-trait = "0.1.92" diff --git a/crates/izlek-core/src/config.rs b/crates/izlek-core/src/config.rs index eca8057..b88bf3d 100644 --- a/crates/izlek-core/src/config.rs +++ b/crates/izlek-core/src/config.rs @@ -205,14 +205,14 @@ mod tests { /// A scratch directory, cleaned up when the test ends, so `load_from` can /// be exercised without touching the process's own working directory. fn scratch() -> PathBuf { - let dir = std::env::temp_dir().join(format!("izlek-config-test-{}", uuid_like())); + let dir = std::env::temp_dir().join(format!("izlek-config-test-{}", unique_suffix())); std::fs::create_dir_all(&dir).unwrap(); dir } /// Good enough uniqueness for a scratch directory name; no need for a - /// real UUID dependency just for this. - fn uuid_like() -> u128 { + /// real ULID dependency just for this. + fn unique_suffix() -> u128 { std::time::SystemTime::now() .duration_since(std::time::UNIX_EPOCH) .unwrap() diff --git a/crates/izlek-core/src/store/secret.rs b/crates/izlek-core/src/store/secret.rs index a0f3778..3c0019f 100644 --- a/crates/izlek-core/src/store/secret.rs +++ b/crates/izlek-core/src/store/secret.rs @@ -172,7 +172,7 @@ mod tests { #[test] fn load_or_create_key_persists_and_restricts() { - let dir = std::env::temp_dir().join(format!("izlek-key-test-{}", uuid_lite())); + let dir = std::env::temp_dir().join(format!("izlek-key-test-{}", unique_suffix())); std::fs::create_dir_all(&dir).unwrap(); let path = dir.join("izlek.key"); let first = load_or_create_key(&path).unwrap(); @@ -187,9 +187,9 @@ mod tests { let _ = std::fs::remove_dir_all(&dir); } - // A tiny stand-in so this module does not reach for the `uuid` crate just + // A tiny stand-in so this module does not reach for the `ulid` crate just // to name a scratch directory. - fn uuid_lite() -> u64 { + fn unique_suffix() -> u64 { use std::time::{SystemTime, UNIX_EPOCH}; SystemTime::now() .duration_since(UNIX_EPOCH) diff --git a/crates/izlek-core/src/store/turso_store.rs b/crates/izlek-core/src/store/turso_store.rs index e639945..3de0453 100644 --- a/crates/izlek-core/src/store/turso_store.rs +++ b/crates/izlek-core/src/store/turso_store.rs @@ -11,7 +11,7 @@ use time::OffsetDateTime; use time::format_description::well_known::Rfc3339; use turso::transaction::TransactionBehavior; use turso::{Builder, Connection, Row, Value, params}; -use uuid::Uuid; +use ulid::Ulid; use super::secret; use super::{ @@ -609,9 +609,9 @@ impl Store for TursoStore { display_name: &str, password_hash: &str, ) -> Result<(Workspace, User)> { - let workspace_id = Uuid::new_v4().to_string(); - let admin_id = Uuid::new_v4().to_string(); - let board_id = Uuid::new_v4().to_string(); + let workspace_id = Ulid::new().to_string(); + let admin_id = Ulid::new().to_string(); + let board_id = Ulid::new().to_string(); let now = now_text()?; let email = fold_email(email); @@ -668,7 +668,7 @@ impl Store for TursoStore { "INSERT INTO board_column (id, board_id, name, position, is_done) \ VALUES (?1, ?2, ?3, ?4, ?5)", params![ - Uuid::new_v4().to_string(), + Ulid::new().to_string(), board_id.clone(), *name, position as i64, @@ -832,7 +832,7 @@ impl Store for TursoStore { { return Err(StoreError::Conflict("account")); } - let id = Uuid::new_v4().to_string(); + let id = Ulid::new().to_string(); self.conn .lock() .await @@ -982,7 +982,7 @@ impl Store for TursoStore { token_hash: &str, expires_at: OffsetDateTime, ) -> Result { - let id = Uuid::new_v4().to_string(); + let id = Ulid::new().to_string(); self.conn .lock() .await @@ -1050,7 +1050,7 @@ impl Store for TursoStore { token_hash: &str, expires_at: OffsetDateTime, ) -> Result { - let id = Uuid::new_v4().to_string(); + let id = Ulid::new().to_string(); self.conn .lock() .await @@ -1124,7 +1124,7 @@ impl Store for TursoStore { conn .execute( "INSERT INTO auth_attempt (id, bucket, attempted_at) VALUES (?1, ?2, ?3)", - params![Uuid::new_v4().to_string(), bucket, stamp(at)?], + params![Ulid::new().to_string(), bucket, stamp(at)?], ) .await .map_err(backend)?; @@ -1179,7 +1179,7 @@ impl Store for TursoStore { is_done: bool, ) -> Result { let conn = self.conn.lock().await; - let id = Uuid::new_v4().to_string(); + let id = Ulid::new().to_string(); conn .execute( "INSERT INTO board_column (id, board_id, name, position, is_done) \ @@ -1197,8 +1197,8 @@ impl Store for TursoStore { } async fn create_task(&self, new: NewTask<'_>) -> Result { - let id = Uuid::new_v4().to_string(); - let activity_id = Uuid::new_v4().to_string(); + let id = Ulid::new().to_string(); + let activity_id = Ulid::new().to_string(); let now = now_text()?; let deadline = new.deadline.map(day_text).transpose()?; @@ -1448,8 +1448,8 @@ impl Store for TursoStore { body: &str, at: OffsetDateTime, ) -> Result { - let comment_id = Uuid::new_v4().to_string(); - let activity_id = Uuid::new_v4().to_string(); + let comment_id = Ulid::new().to_string(); + let activity_id = Ulid::new().to_string(); let when = stamp(at)?; let mut conn = self.tx_conn().await?; @@ -1495,7 +1495,7 @@ impl Store for TursoStore { async fn add_attachment(&self, new: NewAttachment<'_>) -> Result { let conn = self.conn.lock().await; - let id = Uuid::new_v4().to_string(); + let id = Ulid::new().to_string(); let size = new.bytes.len() as i64; conn .execute( @@ -1632,7 +1632,7 @@ impl Store for TursoStore { } let mut ids = Vec::with_capacity(lines.len()); for (kind, detail) in lines { - let id = Uuid::new_v4().to_string(); + let id = Ulid::new().to_string(); tx.execute( "INSERT INTO activity (id, task_id, actor_id, kind, detail, created_at) \ VALUES (?1, ?2, ?3, ?4, ?5, ?6)", @@ -1667,7 +1667,7 @@ impl Store for TursoStore { at: OffsetDateTime, ) -> Result { let stamp = stamp(at)?; - let transition_id = Uuid::new_v4().to_string(); + let transition_id = Ulid::new().to_string(); // Dropping a card back where it came from is not a move. Answer before // opening a transaction: there is nothing to serialise. @@ -1789,7 +1789,7 @@ impl Store for TursoStore { "INSERT INTO activity (id, task_id, actor_id, kind, detail, created_at) \ VALUES (?1, ?2, ?3, ?4, ?5, ?6)", params![ - Uuid::new_v4().to_string(), + Ulid::new().to_string(), task_id, actor_id, ActivityKind::Moved.as_str(), @@ -1887,7 +1887,7 @@ impl Store for TursoStore { params![task_id, stamp.clone()], ) .await?; - let deleted_activity_id = Uuid::new_v4().to_string(); + let deleted_activity_id = Ulid::new().to_string(); tx.execute( "INSERT INTO activity (id, task_id, actor_id, kind, detail, created_at) \ VALUES (?1, ?2, ?3, ?4, '', ?5)", @@ -1925,7 +1925,7 @@ impl Store for TursoStore { "INSERT INTO activity (id, task_id, actor_id, kind, detail, created_at) \ VALUES (?1, ?2, NULL, ?3, ?4, ?5)", params![ - Uuid::new_v4().to_string(), + Ulid::new().to_string(), blocked.clone(), ActivityKind::Unblocked.as_str(), format!("{task_key} was deleted"), @@ -1944,7 +1944,7 @@ impl Store for TursoStore { None } else { let event = Freeing { - id: Uuid::new_v4().to_string(), + id: Ulid::new().to_string(), board_id, cause_key: task_key.clone(), cause_title: title, @@ -2069,7 +2069,7 @@ impl Store for TursoStore { at: OffsetDateTime, ) -> Result { let conn = self.conn.lock().await; - let id = Uuid::new_v4().to_string(); + let id = Ulid::new().to_string(); conn .execute( "INSERT INTO activity (id, task_id, actor_id, kind, detail, created_at) \ @@ -2098,7 +2098,7 @@ impl Store for TursoStore { audience: Audience, at: OffsetDateTime, ) -> Result { - let id = Uuid::new_v4().to_string(); + let id = Ulid::new().to_string(); let (kind, column) = trigger_parts(trigger); self.conn .lock() @@ -2303,7 +2303,7 @@ impl Store for TursoStore { recipient: &str, at: OffsetDateTime, ) -> Result> { - let id = Uuid::new_v4().to_string(); + let id = Ulid::new().to_string(); // The index is the decision. `DO NOTHING` turns the second engine run // into zero rows affected rather than an error to interpret, and the // caller that gets `None` sends nothing. @@ -2345,7 +2345,7 @@ impl Store for TursoStore { body: &str, at: OffsetDateTime, ) -> Result { - let id = Uuid::new_v4().to_string(); + let id = Ulid::new().to_string(); self.conn .lock() .await @@ -2491,7 +2491,7 @@ impl Store for TursoStore { at: OffsetDateTime, ) -> Result<()> { let conn = self.conn.lock().await; - let id = Uuid::new_v4().to_string(); + let id = Ulid::new().to_string(); conn .execute( "INSERT INTO mail_decision (id, rule_id, event_id, task_id, outcome, detail, \ @@ -3003,7 +3003,7 @@ mod probe { #[tokio::test] async fn durability_defaults_are_recorded() { - let dir = std::env::temp_dir().join(format!("izlek-probe-{}", Uuid::new_v4())); + let dir = std::env::temp_dir().join(format!("izlek-probe-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); let path = dir.join("probe.db"); let db = Builder::new_local(path.to_str().unwrap()) @@ -3021,7 +3021,7 @@ mod probe { #[tokio::test] async fn concurrent_writers_on_one_database() { - let dir = std::env::temp_dir().join(format!("izlek-probe-{}", Uuid::new_v4())); + let dir = std::env::temp_dir().join(format!("izlek-probe-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); let path = dir.join("probe.db"); let db = Builder::new_local(path.to_str().unwrap()) @@ -3064,7 +3064,7 @@ mod probe { #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn two_database_handles_on_one_file() { // Two handles on the same file is the shape a second process takes. - let dir = std::env::temp_dir().join(format!("izlek-probe-{}", Uuid::new_v4())); + let dir = std::env::temp_dir().join(format!("izlek-probe-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); let path = dir.join("probe.db"); let p = path.to_str().unwrap().to_string(); @@ -3137,7 +3137,7 @@ mod probe { /// is asserted against the real query rather than against a comment. #[tokio::test] async fn the_workspace_read_path_cannot_carry_the_password() { - let dir = std::env::temp_dir().join(format!("izlek-sender-{}", Uuid::new_v4())); + let dir = std::env::temp_dir().join(format!("izlek-sender-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); let store = TursoStore::open(dir.join("izlek.db").to_str().unwrap()) .await @@ -3193,7 +3193,7 @@ mod migration { /// only half-apply is a migration that can lose the mail ledger. #[tokio::test] async fn a_migration_that_fails_partway_leaves_nothing_behind() { - let dir = std::env::temp_dir().join(format!("izlek-migration-{}", Uuid::new_v4())); + let dir = std::env::temp_dir().join(format!("izlek-migration-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); let store = TursoStore::open(dir.join("izlek.db").to_str().unwrap()) .await diff --git a/crates/izlek-core/tests/store.rs b/crates/izlek-core/tests/store.rs index 72ae58c..e80b3c1 100644 --- a/crates/izlek-core/tests/store.rs +++ b/crates/izlek-core/tests/store.rs @@ -13,7 +13,7 @@ use izlek_core::store::{ SendState, Store, StoreError, Trigger, TursoStore, User, }; use time::{Duration, OffsetDateTime}; -use uuid::Uuid; +use ulid::Ulid; /// A throwaway database on disk. Turso's in-memory mode is not what production /// runs, so the tests exercise a real file. @@ -24,7 +24,7 @@ struct Scratch { impl Scratch { async fn open() -> Self { - let dir = std::env::temp_dir().join(format!("izlek-test-{}", Uuid::new_v4())); + let dir = std::env::temp_dir().join(format!("izlek-test-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); let store = TursoStore::open(dir.join("izlek.db").to_str().unwrap()) .await @@ -102,7 +102,7 @@ async fn member(store: &TursoStore, workspace_id: &str, email: &str, name: &str) /// empty table. async fn a_pre_0013_store_with_a_rule_send_and_decision() -> (PathBuf, String, String, String, String) { - let dir = std::env::temp_dir().join(format!("izlek-test-{}", Uuid::new_v4())); + let dir = std::env::temp_dir().join(format!("izlek-test-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); let path = dir.join("izlek.db").to_string_lossy().into_owned(); @@ -140,14 +140,14 @@ async fn a_pre_0013_store_with_a_rule_send_and_decision() .unwrap(); } - let workspace = Uuid::new_v4().to_string(); - let admin = Uuid::new_v4().to_string(); - let board = Uuid::new_v4().to_string(); - let backlog = Uuid::new_v4().to_string(); - let done = Uuid::new_v4().to_string(); - let task = Uuid::new_v4().to_string(); - let rule = Uuid::new_v4().to_string(); - let transition = Uuid::new_v4().to_string(); + let workspace = Ulid::new().to_string(); + let admin = Ulid::new().to_string(); + let board = Ulid::new().to_string(); + let backlog = Ulid::new().to_string(); + let done = Ulid::new().to_string(); + let task = Ulid::new().to_string(); + let rule = Ulid::new().to_string(); + let transition = Ulid::new().to_string(); conn.execute( "INSERT INTO workspace (id, name, created_at) VALUES (?1, 'Izlek', '2026-08-26T00:00:00Z')", turso::params![workspace.clone()], @@ -231,7 +231,7 @@ async fn a_pre_0013_store_with_a_rule_send_and_decision() #[tokio::test] async fn migrations_apply_once_and_survive_reopen() { - let dir = std::env::temp_dir().join(format!("izlek-test-{}", Uuid::new_v4())); + let dir = std::env::temp_dir().join(format!("izlek-test-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); let path = dir.join("izlek.db").to_string_lossy().into_owned(); @@ -333,7 +333,7 @@ async fn a_second_claim_loses_and_changes_nothing() { #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn concurrent_claims_produce_exactly_one_admin() { - let dir = std::env::temp_dir().join(format!("izlek-test-{}", Uuid::new_v4())); + let dir = std::env::temp_dir().join(format!("izlek-test-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); let path = dir.join("izlek.db").to_string_lossy().into_owned(); let store = std::sync::Arc::new(TursoStore::open(&path).await.unwrap()); @@ -386,7 +386,7 @@ async fn concurrent_claims_produce_exactly_one_admin() { /// come back `Ok`, never that error. #[tokio::test(flavor = "multi_thread", worker_threads = 8)] async fn many_concurrent_callers_never_see_concurrent_use_forbidden() { - let dir = std::env::temp_dir().join(format!("izlek-test-{}", Uuid::new_v4())); + let dir = std::env::temp_dir().join(format!("izlek-test-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); let path = dir.join("izlek.db").to_string_lossy().into_owned(); let store = std::sync::Arc::new(TursoStore::open(&path).await.unwrap()); @@ -822,7 +822,7 @@ async fn profile_and_role_updates_stick() { #[tokio::test] async fn updates_to_a_missing_user_are_not_found() { let scratch = Scratch::open().await; - let missing = Uuid::new_v4().to_string(); + let missing = Ulid::new().to_string(); assert!(matches!( scratch.store.set_password_hash(&missing, "x").await, Err(StoreError::NotFound) @@ -945,7 +945,7 @@ async fn the_store_is_usable_behind_a_trait_object() { #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn a_prefetched_link_is_consumed_exactly_once() { - let dir = std::env::temp_dir().join(format!("izlek-test-{}", Uuid::new_v4())); + let dir = std::env::temp_dir().join(format!("izlek-test-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); let path = dir.join("izlek.db").to_string_lossy().into_owned(); let store = std::sync::Arc::new(TursoStore::open(&path).await.unwrap()); @@ -2899,7 +2899,7 @@ async fn an_orphan_row_is_refused() { .len(); assert_eq!(existing, 1, "only the admin"); - let dir = std::env::temp_dir().join(format!("izlek-fk-{}", Uuid::new_v4())); + let dir = std::env::temp_dir().join(format!("izlek-fk-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); let path = dir.join("izlek.db").to_str().unwrap().to_owned(); { @@ -2976,7 +2976,7 @@ async fn a_rule_that_fires_on_nothing_is_refused_by_the_schema() { // past it: a status rule with no column, straight at the table. The check // constraint is the guard, and if it were ever dropped this insert would // quietly succeed and the engine would carry a rule that matches nothing. - let dir = std::env::temp_dir().join(format!("izlek-test-{}", Uuid::new_v4())); + let dir = std::env::temp_dir().join(format!("izlek-test-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); let path = dir.join("izlek.db").to_string_lossy().into_owned(); let store = TursoStore::open(&path).await.unwrap(); @@ -3436,7 +3436,7 @@ impl Mailer for Remembering { /// A store shared between the tests and an engine. async fn shared() -> (PathBuf, Arc, String, String) { - let dir = std::env::temp_dir().join(format!("izlek-test-{}", Uuid::new_v4())); + let dir = std::env::temp_dir().join(format!("izlek-test-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); let store = Arc::new( TursoStore::open(dir.join("izlek.db").to_str().unwrap()) diff --git a/crates/izlek-web/Cargo.toml b/crates/izlek-web/Cargo.toml index d8a66d3..3eb8271 100644 --- a/crates/izlek-web/Cargo.toml +++ b/crates/izlek-web/Cargo.toml @@ -41,4 +41,4 @@ grass = "0.13" [dev-dependencies] http = "1.5" -uuid = { workspace = true } +ulid = { workspace = true } diff --git a/crates/izlek-web/tests/http.rs b/crates/izlek-web/tests/http.rs index 94e30b7..53ae1ad 100644 --- a/crates/izlek-web/tests/http.rs +++ b/crates/izlek-web/tests/http.rs @@ -29,7 +29,7 @@ use izlek_web::server::{Mail, SESSION_COOKIE}; use topcoat::asset::{AssetBundle, RouterBuilderAssetExt}; use topcoat::cookie::RouterBuilderCookieExt; use topcoat::router::{Body, BodyLimit, Router, RouterBuilderDiscoverExt, to_bytes}; -use uuid::Uuid; +use ulid::Ulid; /// The bundle `cargo build -p izlek-web` + `topcoat asset bundle --bin /// izlek-web` write next to the crate's own `target/debug`, not next to the @@ -49,7 +49,7 @@ struct App { impl App { async fn build(base_url: &str, mail: Mail) -> Self { - let dir = std::env::temp_dir().join(format!("izlek-http-{}", Uuid::new_v4())); + let dir = std::env::temp_dir().join(format!("izlek-http-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); let store: Arc = Arc::new( TursoStore::open(dir.join("izlek.db").to_str().unwrap()) @@ -76,7 +76,7 @@ impl App { /// settings, so a transition actually reaches the ledger instead of the /// silent no-op `open`'s router hands every crossing. async fn open_with_mail() -> Self { - let dir = std::env::temp_dir().join(format!("izlek-http-{}", Uuid::new_v4())); + let dir = std::env::temp_dir().join(format!("izlek-http-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); let store: Arc = Arc::new( TursoStore::open(dir.join("izlek.db").to_str().unwrap()) @@ -1657,7 +1657,7 @@ async fn a_rule_may_not_be_hung_off_a_column_that_is_not_on_this_board() { Some(&admin_cookie), &[ ("trigger", "status"), - ("column_id", &Uuid::new_v4().to_string()), + ("column_id", &Ulid::new().to_string()), ("subject", "Task completed"), ("audience", "assignees"), ], @@ -1706,7 +1706,7 @@ async fn switching_a_rule_off_leaves_it_listed_and_switched_off() { async fn a_rule_id_this_workspace_does_not_own_is_refused() { let app = App::open().await; let admin_cookie = admin(&app).await; - let stranger = Uuid::new_v4().to_string(); + let stranger = Ulid::new().to_string(); for path in ["/api/set_rule_enabled", "/api/delete_rule"] { let answer = app.post(path, Some(&admin_cookie), &[("rule_id", &stranger), ("enabled", "false")]).await;