diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a4c668e..9b780e6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,8 +16,8 @@ env: # broken deploy. In exchange: no cross-toolchain, and the linker is # rustc's default bundled lld. TARGET: x86_64-unknown-linux-gnu - # The systemd user unit that owns the process. See izlek.service. - SERVICE: izlek + # The systemd user unit that owns the process. See iz.service. + SERVICE: iz # `release` keeps fat LTO in one codegen unit for when the last few percent # are worth five minutes. `dist` is that profile with thin LTO and the cores # actually used: measured on a 12-core machine, the relink every deploy pays @@ -29,7 +29,7 @@ env: # itself is resolved on the server ($HOME), so switching the deploy user # moves the path with it — a baked-in absolute path once kept pointing at # the previous user's home and failed the deploy on permissions. - DEPLOY_SUBDIR: izlek + DEPLOY_SUBDIR: iz jobs: deploy: @@ -90,11 +90,11 @@ jobs: - name: Build the binary and bundle its assets run: | set -euo pipefail - # One compile: this builds izlek-web and writes out the asset bundle + # One compile: this builds iz-web and writes out the asset bundle # embedded in the binary it produced. - topcoat asset bundle --package izlek-web --profile "$PROFILE" --out stage/assets - cp "target/$TARGET/$PROFILE/izlek-web" stage/izlek-web - strip stage/izlek-web + topcoat asset bundle --package iz-web --profile "$PROFILE" --out stage/assets + cp "target/$TARGET/$PROFILE/iz-web" stage/iz-web + strip stage/iz-web ls -l stage stage/assets - name: Install SSH keys @@ -125,7 +125,7 @@ jobs: esac deploy_path=$HOME/$1 # The deploy path is the service's working directory: config/, - # izlek.db and izlek.key live there and are never touched from here. + # iz.db and iz.key live there and are never touched from here. # Only 'current' is replaced. mkdir -p -- "$deploy_path" rm -rf -- "$deploy_path/current.new" @@ -150,12 +150,12 @@ jobs: export XDG_RUNTIME_DIR=/run/user/$(id -u) # Read before anything moves: a config the health check cannot # read is a failure to stop on, not one to roll back from. - listen=$(sed -n 's/^listen[[:space:]]*=[[:space:]]*"\(.*\)"/\1/p' "$deploy_path/config/izlek.toml") + listen=$(sed -n 's/^listen[[:space:]]*=[[:space:]]*"\(.*\)"/\1/p' "$deploy_path/config/iz.toml") if [ -z "$listen" ]; then - echo "no listen address in $deploy_path/config/izlek.toml" >&2 + echo "no listen address in $deploy_path/config/iz.toml" >&2 exit 1 fi - chmod +x -- "$deploy_path/current.new/izlek-web" + chmod +x -- "$deploy_path/current.new/iz-web" rm -rf -- "$deploy_path/current.previous" if [ -e "$deploy_path/current" ]; then mv -- "$deploy_path/current" "$deploy_path/current.previous" @@ -166,13 +166,13 @@ jobs: # has bound its port. Wait for the health route rather than a clock. for _ in $(seq 1 30); do if curl -fsS "http://$listen/healthz" >/dev/null 2>&1; then - echo 'izlek is up' + echo 'iz is up' rm -rf -- "$deploy_path/current.previous" exit 0 fi sleep 1 done - echo 'izlek did not answer /healthz; rolling back' >&2 + echo 'iz did not answer /healthz; rolling back' >&2 rm -rf -- "$deploy_path/current" mv -- "$deploy_path/current.previous" "$deploy_path/current" systemctl --user restart "$service" @@ -194,7 +194,7 @@ jobs: ssh "$ssh_target" "bash -se -- '$DEPLOY_SUBDIR'" > served-stylesheet.css <<'REMOTE' set -euo pipefail deploy_path=$HOME/$1 - listen=$(sed -n 's/^listen[[:space:]]*=[[:space:]]*"\(.*\)"/\1/p' "$deploy_path/config/izlek.toml") + listen=$(sed -n 's/^listen[[:space:]]*=[[:space:]]*"\(.*\)"/\1/p' "$deploy_path/config/iz.toml") url=$(curl -fsS "http://${listen}/" | grep -oE '/_topcoat/assets/main-[a-f0-9]+\.css' | head -n1) if [ -z "$url" ]; then echo 'the served page references no stylesheet' >&2 diff --git a/.gitignore b/.gitignore index 9394917..2d93d67 100644 --- a/.gitignore +++ b/.gitignore @@ -5,8 +5,8 @@ *.db-* /storage .env -izlek.key -/config/izlek.toml +iz.key +/config/iz.toml CLAUDE.md -/crates/izlek-web/assets +/crates/iz-web/assets *.db.backup-* diff --git a/Cargo.lock b/Cargo.lock index 64602da..bdf49a8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1777,7 +1777,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" [[package]] -name = "izlek-core" +name = "iz-core" version = "0.1.0" dependencies = [ "argon2", @@ -1800,7 +1800,7 @@ dependencies = [ ] [[package]] -name = "izlek-web" +name = "iz-web" version = "0.1.0" dependencies = [ "async-trait", @@ -1809,7 +1809,7 @@ dependencies = [ "grass", "http", "http-body-util", - "izlek-core", + "iz-core", "lettre", "quick-xml", "serde", diff --git a/Cargo.toml b/Cargo.toml index 4bd9b08..b4c4fc7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,15 +1,15 @@ [workspace] resolver = "3" -members = ["crates/izlek-core", "crates/izlek-web"] +members = ["crates/iz-core", "crates/iz-web"] [workspace.package] version = "0.1.0" edition = "2024" license = "AGPL-3.0-or-later" -repository = "https://github.com/IzlekLab/izlek" +repository = "https://github.com/DizeyLab/iz" [workspace.dependencies] -izlek-core = { path = "crates/izlek-core", default-features = false } +iz-core = { path = "crates/iz-core", default-features = false } serde = { version = "1.0.229", features = ["derive"] } serde_json = "1.0.145" thiserror = "2.0.20" diff --git a/config/izlek.toml b/config/iz.toml similarity index 100% rename from config/izlek.toml rename to config/iz.toml diff --git a/crates/izlek-core/Cargo.toml b/crates/iz-core/Cargo.toml similarity index 94% rename from crates/izlek-core/Cargo.toml rename to crates/iz-core/Cargo.toml index 081581d..cce6652 100644 --- a/crates/izlek-core/Cargo.toml +++ b/crates/iz-core/Cargo.toml @@ -1,10 +1,10 @@ [package] -name = "izlek-core" +name = "iz-core" version.workspace = true edition.workspace = true license.workspace = true repository.workspace = true -description = "Domain model and storage for İzlek" +description = "Domain model and storage for İz" [features] # The domain vocabulary (roles, record shapes) compiles anywhere, including the diff --git a/crates/izlek-core/migrations/0001_init.sql b/crates/iz-core/migrations/0001_init.sql similarity index 99% rename from crates/izlek-core/migrations/0001_init.sql rename to crates/iz-core/migrations/0001_init.sql index 6e05fa3..f52e8ff 100644 --- a/crates/izlek-core/migrations/0001_init.sql +++ b/crates/iz-core/migrations/0001_init.sql @@ -1,4 +1,4 @@ --- Izlek's schema, whole, in one file. +-- Iz's schema, whole, in one file. -- -- One plain SQL file, applied at boot to an empty database: Turso has no -- migration runner of its own, and keeping the schema as SQL is what makes @@ -9,7 +9,7 @@ -- -- This file is the whole schema, and it is edited in place: a change to a -- table is made here, in the table, never appended as an ALTER. An existing --- database is brought up to it by `izlek reconcile`, not by the store, so a +-- database is brought up to it by `iz reconcile`, not by the store, so a -- change to a table lands in two places — here, and in that tool's copy map. CREATE TABLE workspace ( @@ -40,7 +40,7 @@ CREATE TABLE workspace ( -- `smtp_password` holds ciphertext, never the typed string. The server -- has to present the password to the mail host on every send, so a -- one-way hash is impossible; instead `store::secret` seals it under a - -- key kept in `izlek.key` beside this file, so a database copied for a + -- key kept in `iz.key` beside this file, so a database copied for a -- backup does not carry a working credential with it. No field on -- `Workspace` exposes it — it is written by `Store::set_sender` and read -- by `Store::smtp_password`, which only the mailer calls. @@ -74,7 +74,7 @@ CREATE TABLE workspace ( -- The address mail links point at, when the one the process was -- configured with is not the one people reach. A box behind a proxy -- answers on localhost and is known by a public name, and only an admin - -- knows which — so it is workspace content, and `config/izlek.toml`'s + -- knows which — so it is workspace content, and `config/iz.toml`'s -- `base_url` is what an empty one falls back to. public_url TEXT ); diff --git a/crates/izlek-core/src/accounts.rs b/crates/iz-core/src/accounts.rs similarity index 98% rename from crates/izlek-core/src/accounts.rs rename to crates/iz-core/src/accounts.rs index 9c415a0..4185104 100644 --- a/crates/izlek-core/src/accounts.rs +++ b/crates/iz-core/src/accounts.rs @@ -89,7 +89,7 @@ pub struct Accounts { /// The origin the sign-in link in an invite mail points at, with no /// trailing slash. /// The address a mailed link carries when no admin has set one: the - /// address the process binds, from `config/izlek.toml`. + /// address the process binds, from `config/iz.toml`. fallback_url: String, } @@ -234,9 +234,9 @@ impl Accounts { self.store .create_signin_link(&user.id, &token.hash(), expires_at, LinkKind::Join) .await?; - let subject = "Your İzlek sign-in link"; + let subject = "Your İz sign-in link"; let body = format!( - "{actor} added you to İzlek.\n\n{base}/join/{token}\n\nThe link works once and expires in 7 days.\n", + "{actor} added you to İz.\n\n{base}/join/{token}\n\nThe link works once and expires in 7 days.\n", actor = actor.display_name, base = self.base().await?, token = token.expose(), @@ -635,18 +635,18 @@ impl Accounts { fn reset_mail(user: &User, base: String, token: &str) -> (String, String) { if user.language == "tr" { ( - "İzlek parolanı sıfırla".to_string(), + "İz parolanı sıfırla".to_string(), format!( - "Bu adres için bir İzlek parola sıfırlaması istendi.\n\n\ + "Bu adres için bir İz parola sıfırlaması istendi.\n\n\ {base}/reset/{token}\n\n\ Bağlantı bir kez çalışır ve 7 gün içinde geçersiz olur.\n" ), ) } else { ( - "Reset your İzlek password".to_string(), + "Reset your İz password".to_string(), format!( - "A reset was asked for the İzlek password on this address.\n\n\ + "A reset was asked for the İz password on this address.\n\n\ {base}/reset/{token}\n\n\ The link works once and expires in 7 days.\n" ), diff --git a/crates/izlek-core/src/auth.rs b/crates/iz-core/src/auth.rs similarity index 95% rename from crates/izlek-core/src/auth.rs rename to crates/iz-core/src/auth.rs index ded5444..e74735b 100644 --- a/crates/izlek-core/src/auth.rs +++ b/crates/iz-core/src/auth.rs @@ -198,7 +198,11 @@ mod tests { #[test] fn a_password_sharing_nothing_with_the_person_is_accepted() { assert_eq!( - check_password("abcde*abcde", "burakboduroglu0@gmail.com", "Burak Boduroğlu"), + check_password( + "abcde*abcde", + "burakboduroglu0@gmail.com", + "Burak Boduroğlu" + ), Ok(()) ); } @@ -254,11 +258,11 @@ mod tests { #[test] fn known_answer_for_the_token_digest() { - // SHA-256("izlek"), so a refactor cannot quietly change the algorithm + // SHA-256("iz"), so a refactor cannot quietly change the algorithm // under stored hashes. assert_eq!( - hash_token("izlek"), - "d81eac046551d3591888f0c7012b8faece2cc3501f63398bc040118bfd835d8e" + hash_token("iz"), + "a93c5a18c1c1da1c799d05b4be13c8de48b5fb5db7d686c3356614cf21ae7855" ); } @@ -272,7 +276,7 @@ mod tests { #[test] fn password_rules_are_the_ones_on_the_screen() { - let email = "grace@izlek.sh"; + let email = "grace@iz.sh"; let name = "Grace Hopper"; assert_eq!( check_password("short", email, name), @@ -288,7 +292,7 @@ mod tests { "case must not be an escape hatch" ); assert_eq!( - check_password("grace@izlek.sh!!", email, name), + check_password("grace@iz.sh!!", email, name), Err(PasswordProblem::LooksLikeYou) ); assert!(check_password("tide-tables-1892", email, name).is_ok()); @@ -303,7 +307,7 @@ mod tests { #[cfg(test)] mod dummy_hash_generator { - //! Run with `cargo test -p izlek-core --lib print_a_dummy_hash -- --ignored + //! Run with `cargo test -p iz-core --lib print_a_dummy_hash -- --ignored //! --nocapture` to mint a replacement for [`super::dummy_password_hash`]. #[test] #[ignore = "generator, not a check"] diff --git a/crates/izlek-core/src/board.rs b/crates/iz-core/src/board.rs similarity index 100% rename from crates/izlek-core/src/board.rs rename to crates/iz-core/src/board.rs diff --git a/crates/izlek-core/src/config.rs b/crates/iz-core/src/config.rs similarity index 90% rename from crates/izlek-core/src/config.rs rename to crates/iz-core/src/config.rs index 75d0d2b..a8c7cd9 100644 --- a/crates/izlek-core/src/config.rs +++ b/crates/iz-core/src/config.rs @@ -1,15 +1,15 @@ -//! Everything İzlek reads from `config/izlek.toml`, in one place. +//! Everything İz reads from `config/iz.toml`, in one place. //! //! Nothing here has a silent default once the file exists. A key that is //! missing, empty or unusable stops the boot and says which key and which //! file, because the alternative is worse than not starting: a wrong -//! `database` does not mean "no data", it means a second İzlek quietly +//! `database` does not mean "no data", it means a second İz quietly //! writing a different file while everyone believes they are looking at the //! same board — and Turso is single-writer, so the two are not even //! reconcilable afterwards. //! //! Development still needs to be one command, so the *absence* of -//! `config/izlek.toml` is the opt-in that takes the development defaults: the +//! `config/iz.toml` is the opt-in that takes the development defaults: the //! app writes the file itself, with those defaults in it and comments saying //! what each key does, and starts. That is opt-in on purpose too — it only //! ever happens once, because the second boot finds the file it wrote the @@ -41,16 +41,16 @@ use std::path::{Path, PathBuf}; /// The path, relative to the working directory, of the file `Config::load` /// reads and, failing that, writes. -const FILE_NAME: &str = "config/izlek.toml"; +const FILE_NAME: &str = "config/iz.toml"; -/// What a freshly written `config/izlek.toml` says, comments included. Development -/// defaults, so that a plain `izlek` in an empty directory is one command. +/// What a freshly written `config/iz.toml` says, comments included. Development +/// defaults, so that a plain `iz` in an empty directory is one command. const DEVELOPMENT_DEFAULTS: &str = r#"# Where the one database file lives. One process holds it. -database = "izlek.db" +database = "iz.db" # Where attachments and profile photos live as files, created on boot. storage = "storage" # The address the server listens on. Environment variables are ignored — -# this is the only thing that decides where İzlek binds. It is also the +# this is the only thing that decides where İz binds. It is also the # address mail links fall back to, until an admin sets one in Settings. listen = "127.0.0.1:7654" # How long a live-update connection is held before the browser is asked to @@ -86,7 +86,7 @@ const OPTIONAL_KEYS: &[(&str, &str)] = &[ "listen", concat!( "# The address the server listens on. Environment variables are ignored —\n", - "# this is the only thing that decides where İzlek binds. It is also the\n", + "# this is the only thing that decides where İz binds. It is also the\n", "# address mail links fall back to, until an admin sets one in Settings.\n", "listen = \"127.0.0.1:7654\"\n" ), @@ -102,7 +102,7 @@ const OPTIONAL_KEYS: &[(&str, &str)] = &[ ), ]; -/// The shape of `config/izlek.toml`, before the values are checked. Anything +/// The shape of `config/iz.toml`, before the values are checked. Anything /// else the file says lands in `other`, which is read for its key names only /// — enough for the report to say a key was seen and not obeyed. #[derive(Deserialize)] @@ -134,7 +134,7 @@ pub struct Config { /// asked to reconnect. The reconnect re-authenticates, which is how a /// session revoked mid-stream stops being fed. pub live_seconds: u64, - /// Whether `config/izlek.toml` did not exist and was just written with the + /// Whether `config/iz.toml` did not exist and was just written with the /// development defaults this boot. pub defaulted: bool, } @@ -179,7 +179,7 @@ impl fmt::Display for ConfigError { impl std::error::Error for ConfigError {} impl Config { - /// Reads `config/izlek.toml` from the current directory, writing it with + /// Reads `config/iz.toml` from the current directory, writing it with /// the development defaults first if it is not there. pub fn load() -> Result { Config::load_from(Path::new(".")) @@ -187,7 +187,7 @@ impl Config { /// The same reading, against any directory — which is how it is tested /// without a test being able to disturb another test's working - /// directory, or another test's `config/izlek.toml`. + /// directory, or another test's `config/iz.toml`. pub fn load_from(dir: &Path) -> Result { let path = dir.join(FILE_NAME); match std::fs::read_to_string(&path) { @@ -206,7 +206,7 @@ impl Config { ConfigError::Io(format!("could not write {}: {err}", path.display())) })?; println!( - "izlek wrote {FILE_NAME} with development defaults — edit it for a real deployment" + "iz wrote {FILE_NAME} with development defaults — edit it for a real deployment" ); Config::parse(DEVELOPMENT_DEFAULTS, dir, true) } @@ -268,7 +268,7 @@ impl Config { /// A bind that names no interface — `0.0.0.0`, `::` — answers everywhere /// and is reachable at none of it by name, so the loopback stands in: a /// link somebody on the box can click beats a link nobody can. Whoever - /// puts İzlek behind a proxy sets the real address in Settings, which is + /// puts İz behind a proxy sets the real address in Settings, which is /// the only thing this defers to. pub fn listen_url(&self) -> String { let ip = self.listen.ip(); @@ -364,14 +364,14 @@ fn complete(path: &Path, text: &str, base: &Path) { ); match std::fs::write(path, completed) { Ok(()) => println!( - "izlek added {} to {FILE_NAME}, at the default already in use", + "iz added {} to {FILE_NAME}, at the default already in use", missing .iter() .map(|(key, _)| *key) .collect::>() .join(", ") ), - Err(err) => println!("izlek could not complete {FILE_NAME}: {err}"), + Err(err) => println!("iz could not complete {FILE_NAME}: {err}"), } } @@ -397,7 +397,7 @@ fn default_storage(database: &Path) -> PathBuf { } /// An absolute path for a file that may not exist yet: the directory is -/// resolved against `base` (the directory `config/izlek.toml` was read +/// resolved against `base` (the directory `config/iz.toml` was read /// from), the file name is kept as written. fn absolute(base: &Path, path: &Path) -> PathBuf { if path.is_absolute() { @@ -423,7 +423,7 @@ 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-{}", unique_suffix())); + let dir = std::env::temp_dir().join(format!("iz-config-test-{}", unique_suffix())); std::fs::create_dir_all(&dir).unwrap(); dir } @@ -444,7 +444,7 @@ mod tests { let config = Config::load_from(&dir).unwrap(); assert!(config.defaulted); assert!(config.database.is_absolute(), "{:?}", config.database); - assert!(config.database.ends_with("izlek.db")); + assert!(config.database.ends_with("iz.db")); assert_eq!(config.listen, "127.0.0.1:7654".parse().unwrap()); assert_eq!(config.listen_url(), "http://127.0.0.1:7654"); @@ -473,7 +473,7 @@ mod tests { std::fs::create_dir_all(dir.join("config")).unwrap(); std::fs::write( dir.join(FILE_NAME), - "# mine\ndatabase = \"state/izlek.db\"\n", + "# mine\ndatabase = \"state/iz.db\"\n", ) .unwrap(); @@ -483,11 +483,11 @@ mod tests { let written = std::fs::read_to_string(dir.join(FILE_NAME)).unwrap(); assert!(written.contains("listen = \"127.0.0.1:7654\""), "{written}"); // `storage` has no literal default: the completed line is where the - // file's own `database` put it — beside `state/izlek.db` here. + // file's own `database` put it — beside `state/iz.db` here. assert!(written.contains("storage = "), "{written}"); // What was there is untouched, comment and all. assert!( - written.starts_with("# mine\ndatabase = \"state/izlek.db\"\n"), + written.starts_with("# mine\ndatabase = \"state/iz.db\"\n"), "{written}" ); @@ -507,7 +507,7 @@ mod tests { fn completion_leaves_a_key_that_is_already_there() { let dir = scratch(); std::fs::create_dir_all(dir.join("config")).unwrap(); - let mine = "database = \"izlek.db\"\nstorage = \"files\"\n\ + let mine = "database = \"iz.db\"\nstorage = \"files\"\n\ listen = \"0.0.0.0:8080\"\nlive_seconds = 30\n"; std::fs::write(dir.join(FILE_NAME), mine).unwrap(); let config = Config::load_from(&dir).unwrap(); @@ -523,12 +523,12 @@ mod tests { #[test] fn a_file_without_storage_puts_it_beside_the_database() { let config = Config::parse( - "database = \"/srv/izlek/izlek.db\"\n", + "database = \"/srv/iz/iz.db\"\n", Path::new("."), false, ) .unwrap(); - assert_eq!(config.storage, PathBuf::from("/srv/izlek/storage")); + assert_eq!(config.storage, PathBuf::from("/srv/iz/storage")); } /// An explicit storage is taken absolute, the way the database is. @@ -536,7 +536,7 @@ mod tests { fn a_relative_storage_is_reported_absolute() { let dir = scratch(); let config = Config::parse( - "database = \"izlek.db\"\nstorage = \"state/files\"\n", + "database = \"iz.db\"\nstorage = \"state/files\"\n", &dir, false, ) @@ -555,7 +555,7 @@ mod tests { #[test] fn a_zero_live_window_stops_the_boot_naming_the_key() { let problem = Config::parse( - "database = \"izlek.db\"\nlive_seconds = 0\n", + "database = \"iz.db\"\nlive_seconds = 0\n", Path::new("."), false, ) @@ -575,7 +575,7 @@ mod tests { /// A file that never mentions the key still boots, on the default. #[test] fn a_file_without_a_live_window_takes_the_default() { - let config = Config::parse("database = \"izlek.db\"\n", Path::new("."), false).unwrap(); + let config = Config::parse("database = \"iz.db\"\n", Path::new("."), false).unwrap(); assert_eq!(config.live_seconds, 300); } @@ -592,7 +592,7 @@ mod tests { assert_eq!(problem, ConfigError::Missing("database")); let said = problem.to_string(); assert!(said.contains("database"), "{said}"); - assert!(said.contains("izlek.toml"), "{said}"); + assert!(said.contains("iz.toml"), "{said}"); } #[test] @@ -603,15 +603,15 @@ mod tests { matches!(problem, ConfigError::Unparseable { .. }), "{problem:?}" ); - assert!(problem.to_string().contains("izlek.toml")); + assert!(problem.to_string().contains("iz.toml")); } #[test] fn a_relative_database_is_reported_absolute() { let dir = scratch(); - let config = Config::parse("database = \"state/izlek.db\"\n", &dir, false).unwrap(); + let config = Config::parse("database = \"state/iz.db\"\n", &dir, false).unwrap(); assert!(config.database.is_absolute(), "{:?}", config.database); - assert!(config.database.ends_with("izlek.db")); + assert!(config.database.ends_with("iz.db")); let report = config.report().join("\n"); assert!( report.contains(&config.database.display().to_string()), @@ -625,14 +625,14 @@ mod tests { #[test] fn a_file_without_listen_takes_the_default() { let config = - Config::parse("database = \"/srv/izlek.db\"\n", Path::new("."), false).unwrap(); + Config::parse("database = \"/srv/iz.db\"\n", Path::new("."), false).unwrap(); assert_eq!(config.listen, "127.0.0.1:7654".parse().unwrap()); } #[test] fn an_unparseable_listen_stops_the_boot_naming_the_key() { let problem = Config::parse( - "database = \"/srv/izlek.db\"\nlisten = \"not an address\"\n", + "database = \"/srv/iz.db\"\nlisten = \"not an address\"\n", Path::new("."), false, ) @@ -649,7 +649,7 @@ mod tests { fn the_mail_fallback_is_the_address_the_server_binds() { let url = |listen: &str| { Config::parse( - &format!("database = \"/srv/izlek.db\"\nlisten = \"{listen}\"\n"), + &format!("database = \"/srv/iz.db\"\nlisten = \"{listen}\"\n"), Path::new("."), false, ) @@ -677,7 +677,7 @@ mod tests { #[test] fn keys_nothing_reads_are_named_rather_than_obeyed() { let config = Config::parse( - "database = \"/srv/izlek.db\"\nbase_url = \"https://izlek.sh\"\n\ + "database = \"/srv/iz.db\"\nbase_url = \"https://iz.sh\"\n\ smtp_password = \"hunter2-and-then-some\"\n", Path::new("."), false, diff --git a/crates/izlek-core/src/detail.rs b/crates/iz-core/src/detail.rs similarity index 100% rename from crates/izlek-core/src/detail.rs rename to crates/iz-core/src/detail.rs diff --git a/crates/izlek-core/src/lib.rs b/crates/iz-core/src/lib.rs similarity index 96% rename from crates/izlek-core/src/lib.rs rename to crates/iz-core/src/lib.rs index 0c6c923..2365fd8 100644 --- a/crates/izlek-core/src/lib.rs +++ b/crates/iz-core/src/lib.rs @@ -1,4 +1,4 @@ -//! Domain model and storage for İzlek. +//! Domain model and storage for İz. //! //! The vocabulary — roles and record shapes — compiles everywhere, so the UI //! and the server speak the same types. The `server` feature adds the halves diff --git a/crates/izlek-core/src/live.rs b/crates/iz-core/src/live.rs similarity index 100% rename from crates/izlek-core/src/live.rs rename to crates/iz-core/src/live.rs diff --git a/crates/izlek-core/src/mail.rs b/crates/iz-core/src/mail.rs similarity index 99% rename from crates/izlek-core/src/mail.rs rename to crates/iz-core/src/mail.rs index 8c64664..b77e32d 100644 --- a/crates/izlek-core/src/mail.rs +++ b/crates/iz-core/src/mail.rs @@ -9,7 +9,7 @@ //! //! Nobody is ever mailed about their own action. A rule's audience is resolved //! and the person who did the thing is taken off it, on every audience, always: -//! three people on one board do not need İzlek telling each of them what they +//! three people on one board do not need İz telling each of them what they //! themselves just did. A rule whose audience is only the actor sends nothing //! and owes nothing — that is not a failure and does not appear as one. //! @@ -186,8 +186,8 @@ impl Engine { pub async fn send_test(&self, to: &str) -> std::result::Result { let mail = Outgoing { to: to.to_string(), - subject: "İzlek test mail".to_string(), - body: "Somebody pressed the test button in İzlek's settings, and this \ + subject: "İz test mail".to_string(), + body: "Somebody pressed the test button in İz's settings, and this \ is what came out. Nothing else was sent, and nobody else was \ written to.\n" .to_string(), @@ -557,7 +557,7 @@ impl Engine { .await?; return Ok(()); } - // The workspace's quiet window. Zero is what İzlek did before it had + // The workspace's quiet window. Zero is what İz did before it had // one: every trigger its own mail, sent as soon as it is owed. let window = self .store diff --git a/crates/izlek-core/src/role.rs b/crates/iz-core/src/role.rs similarity index 100% rename from crates/izlek-core/src/role.rs rename to crates/iz-core/src/role.rs diff --git a/crates/izlek-core/src/store/mod.rs b/crates/iz-core/src/store/mod.rs similarity index 100% rename from crates/izlek-core/src/store/mod.rs rename to crates/iz-core/src/store/mod.rs diff --git a/crates/izlek-core/src/store/reconcile.rs b/crates/iz-core/src/store/reconcile.rs similarity index 98% rename from crates/izlek-core/src/store/reconcile.rs rename to crates/iz-core/src/store/reconcile.rs index 4ef2830..e282ddf 100644 --- a/crates/izlek-core/src/store/reconcile.rs +++ b/crates/iz-core/src/store/reconcile.rs @@ -1077,26 +1077,26 @@ mod tests { #[test] fn backup_name_has_no_colons_or_spaces() { - let name = backup_name("/tmp/izlek.db").unwrap(); - assert!(name.starts_with("/tmp/izlek.db.backup-")); + let name = backup_name("/tmp/iz.db").unwrap(); + assert!(name.starts_with("/tmp/iz.db.backup-")); assert!(!name.contains(':')); assert!(!name.contains(' ')); } #[test] fn backup_name_avoids_collision() { - let first = backup_name("/tmp/izlek.db").unwrap(); + let first = backup_name("/tmp/iz.db").unwrap(); std::fs::File::create(&first).unwrap(); - let second = backup_name("/tmp/izlek.db").unwrap(); + let second = backup_name("/tmp/iz.db").unwrap(); assert_ne!(first, second); std::fs::remove_file(&first).unwrap(); } #[tokio::test] async fn validate_maps_refuses_a_declared_table_without_a_map() { - let dir = std::env::temp_dir().join(format!("izlek-validate-{}", Ulid::new())); + let dir = std::env::temp_dir().join(format!("iz-validate-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); - let path = dir.join("izlek.db").to_str().unwrap().to_string(); + let path = dir.join("iz.db").to_str().unwrap().to_string(); let db = Builder::new_local(&path).build().await.unwrap(); let conn = db.connect().unwrap(); conn.execute_batch(SCHEMA).await.unwrap(); @@ -1147,14 +1147,14 @@ mod tests { conn.execute( "INSERT INTO user (id, workspace_id, email, display_name, role, photo_mime, photo, \ created_at) \ - VALUES ('U1', 'W1', 'one@izlek.sh', 'One', 'admin', 'image/png', ?1, ?2)", + VALUES ('U1', 'W1', 'one@iz.sh', 'One', 'admin', 'image/png', ?1, ?2)", params![&photo_bytes[..], now], ) .await .unwrap(); conn.execute( "INSERT INTO user (id, workspace_id, email, display_name, role, created_at) \ - VALUES ('U2', 'W1', 'two@izlek.sh', 'Two', 'member', ?1)", + VALUES ('U2', 'W1', 'two@iz.sh', 'Two', 'member', ?1)", params![now], ) .await @@ -1211,9 +1211,9 @@ mod tests { /// column any more. #[tokio::test] async fn an_old_shaped_database_extracts_its_blobs_to_the_storage_dir() { - let dir = std::env::temp_dir().join(format!("izlek-reconcile-{}", Ulid::new())); + let dir = std::env::temp_dir().join(format!("iz-reconcile-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); - let path = dir.join("izlek.db").to_str().unwrap().to_string(); + let path = dir.join("iz.db").to_str().unwrap().to_string(); let (attachment_bytes, photo_bytes) = old_shape_database(&path).await; let storage = dir.join("storage"); @@ -1260,9 +1260,9 @@ mod tests { /// leaves the original file in place with nothing staged beside it. #[tokio::test] async fn a_rebuild_without_storage_refuses_to_drop_blobs() { - let dir = std::env::temp_dir().join(format!("izlek-reconcile-{}", Ulid::new())); + let dir = std::env::temp_dir().join(format!("iz-reconcile-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); - let path = dir.join("izlek.db").to_str().unwrap().to_string(); + let path = dir.join("iz.db").to_str().unwrap().to_string(); old_shape_database(&path).await; let err = reconcile( diff --git a/crates/izlek-core/src/store/schema.rs b/crates/iz-core/src/store/schema.rs similarity index 100% rename from crates/izlek-core/src/store/schema.rs rename to crates/iz-core/src/store/schema.rs diff --git a/crates/izlek-core/src/store/secret.rs b/crates/iz-core/src/store/secret.rs similarity index 97% rename from crates/izlek-core/src/store/secret.rs rename to crates/iz-core/src/store/secret.rs index 3c0019f..0a76293 100644 --- a/crates/izlek-core/src/store/secret.rs +++ b/crates/iz-core/src/store/secret.rs @@ -5,7 +5,7 @@ //! file — a backup, a snapshot, an `scp` by someone who should not have had //! it — carries the plaintext right along with it. This module is the fix: //! the column holds ciphertext, and the key that opens it lives in a second -//! file (`izlek.key`, beside the database) that a database backup does not +//! file (`iz.key`, beside the database) that a database backup does not //! automatically include. //! //! The envelope is `v1:` followed by base64 of a 24-byte XChaCha20-Poly1305 @@ -172,9 +172,9 @@ mod tests { #[test] fn load_or_create_key_persists_and_restricts() { - let dir = std::env::temp_dir().join(format!("izlek-key-test-{}", unique_suffix())); + let dir = std::env::temp_dir().join(format!("iz-key-test-{}", unique_suffix())); std::fs::create_dir_all(&dir).unwrap(); - let path = dir.join("izlek.key"); + let path = dir.join("iz.key"); let first = load_or_create_key(&path).unwrap(); let second = load_or_create_key(&path).unwrap(); assert_eq!(first, second, "a second open reuses the same key"); diff --git a/crates/izlek-core/src/store/sniff.rs b/crates/iz-core/src/store/sniff.rs similarity index 100% rename from crates/izlek-core/src/store/sniff.rs rename to crates/iz-core/src/store/sniff.rs diff --git a/crates/izlek-core/src/store/turso_store.rs b/crates/iz-core/src/store/turso_store.rs similarity index 99% rename from crates/izlek-core/src/store/turso_store.rs rename to crates/iz-core/src/store/turso_store.rs index 1860816..2c3e2a8 100644 --- a/crates/izlek-core/src/store/turso_store.rs +++ b/crates/iz-core/src/store/turso_store.rs @@ -3,7 +3,7 @@ //! Turso is in-process and SQLite-compatible, so the schema is plain SQL and //! there is no server to run alongside the binary. It ships no migration runner //! of its own; [`TursoStore::open`] applies the numbered files in -//! `crates/izlek-core/migrations` at boot and records the version. +//! `crates/iz-core/migrations` at boot and records the version. use async_trait::async_trait; use rand::Rng; @@ -799,7 +799,7 @@ async fn recipients_from(rows: &mut turso::Rows) -> Result> { } /// `path` with its file name suffixed, for the WAL/SHM files Turso may leave -/// beside the main one (`izlek.db-wal`, `izlek.db-shm`). +/// beside the main one (`iz.db-wal`, `iz.db-shm`). fn sibling(path: &str, suffix: &str) -> std::path::PathBuf { let mut name = std::path::Path::new(path) .file_name() @@ -948,7 +948,7 @@ fn load_key(path: &str) -> Result { .parent() .filter(|d| !d.as_os_str().is_empty()) .unwrap_or_else(|| std::path::Path::new(".")); - secret::load_or_create_key(&dir.join("izlek.key")).map_err(backend) + secret::load_or_create_key(&dir.join("iz.key")).map_err(backend) } fn backend(e: E) -> StoreError { @@ -1404,7 +1404,7 @@ impl Store for TursoStore { None => return Err(StoreError::NotFound), }; // A decrypt failure — wrong key, damaged ciphertext, a restored - // backup missing its `izlek.key` — comes back as `None` rather than + // backup missing its `iz.key` — comes back as `None` rather than // an error. To every caller that is indistinguishable from a // workspace that never had a sender, which is the intended // degradation: mail send falls back to the no-sender path instead of @@ -5179,7 +5179,7 @@ mod probe { #[tokio::test] async fn durability_defaults_are_recorded() { - let dir = std::env::temp_dir().join(format!("izlek-probe-{}", Ulid::new())); + let dir = std::env::temp_dir().join(format!("iz-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()) @@ -5197,7 +5197,7 @@ mod probe { #[tokio::test] async fn concurrent_writers_on_one_database() { - let dir = std::env::temp_dir().join(format!("izlek-probe-{}", Ulid::new())); + let dir = std::env::temp_dir().join(format!("iz-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()) @@ -5240,7 +5240,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-{}", Ulid::new())); + let dir = std::env::temp_dir().join(format!("iz-probe-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); let path = dir.join("probe.db"); let p = path.to_str().unwrap().to_string(); @@ -5313,15 +5313,15 @@ 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-{}", Ulid::new())); + let dir = std::env::temp_dir().join(format!("iz-sender-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); - let store = TursoStore::open(dir.join("izlek.db").to_str().unwrap(), &dir.join("storage")) + let store = TursoStore::open(dir.join("iz.db").to_str().unwrap(), &dir.join("storage")) .await .unwrap(); use crate::store::Store as _; let (ws, _admin) = store - .claim_workspace("İzlek", "ada@izlek.sh", "Ada", "hash") + .claim_workspace("İz", "ada@iz.sh", "Ada", "hash") .await .unwrap(); store @@ -5330,10 +5330,10 @@ mod probe { NewSender { host: "smtp.fastmail.com".into(), port: 587, - username: "izlek".into(), + username: "iz".into(), password: Some("hunter2-and-then-some".into()), - from_name: "İzlek".into(), - from_address: "izlek@izlek.sh".into(), + from_name: "İz".into(), + from_address: "iz@iz.sh".into(), }, ) .await @@ -5382,7 +5382,7 @@ mod storage_fs { async fn open() -> Self { let dir = tempfile::tempdir().unwrap(); let store = TursoStore::open( - dir.path().join("izlek.db").to_str().unwrap(), + dir.path().join("iz.db").to_str().unwrap(), &dir.path().join("storage"), ) .await @@ -5398,7 +5398,7 @@ mod storage_fs { async fn with_task(&self) -> (String, String, String) { let (ws, admin) = self .store - .claim_workspace("İzlek", "ada@izlek.sh", "Ada", "hash") + .claim_workspace("İz", "ada@iz.sh", "Ada", "hash") .await .unwrap(); let admin = admin.id; @@ -5539,7 +5539,7 @@ mod storage_fs { // A reopen is a boot; the sweep runs inside it. let Fixture { store, dir } = fx; drop(store); - let db_path = dir.path().join("izlek.db").to_str().unwrap().to_string(); + let db_path = dir.path().join("iz.db").to_str().unwrap().to_string(); let storage = dir.path().join("storage"); let store = TursoStore::open(&db_path, &storage).await.unwrap(); assert_eq!(std::fs::read_dir(&attachments).unwrap().count(), 0); @@ -5575,7 +5575,7 @@ mod storage_fs { let Fixture { store, dir } = fx; drop(store); - let db_path = dir.path().join("izlek.db").to_str().unwrap().to_string(); + let db_path = dir.path().join("iz.db").to_str().unwrap().to_string(); let storage = dir.path().join("storage"); let store = TursoStore::open(&db_path, &storage).await.unwrap(); // Both rows survive the sweep; the reads answer "nothing to serve". @@ -5609,7 +5609,7 @@ mod storage_fs { .unwrap(); let Fixture { store, dir } = fx; drop(store); - let db_path = dir.path().join("izlek.db").to_str().unwrap().to_string(); + let db_path = dir.path().join("iz.db").to_str().unwrap().to_string(); let storage = dir.path().join("storage"); let store = TursoStore::open(&db_path, &storage).await.unwrap(); assert_eq!( diff --git a/crates/izlek-core/tests/fixtures/pre-collapse/0001_init.sql b/crates/iz-core/tests/fixtures/pre-collapse/0001_init.sql similarity index 98% rename from crates/izlek-core/tests/fixtures/pre-collapse/0001_init.sql rename to crates/iz-core/tests/fixtures/pre-collapse/0001_init.sql index 302abac..1764f51 100644 --- a/crates/izlek-core/tests/fixtures/pre-collapse/0001_init.sql +++ b/crates/iz-core/tests/fixtures/pre-collapse/0001_init.sql @@ -1,4 +1,4 @@ --- Izlek's schema, whole, in one file. +-- Iz's schema, whole, in one file. -- -- Plain versioned SQL applied at boot: Turso has no migration runner of its -- own, and keeping the schema as SQL is what makes the store trait swappable. @@ -11,7 +11,7 @@ -- database it describes is recreated — twenty migrations were collapsed into -- this file once for that reason, and a twenty-first would start the same rot -- over. The reasoning the old migrations carried is kept, on the tables it --- explains. The day Izlek runs somewhere with data worth keeping, the next +-- explains. The day Iz runs somewhere with data worth keeping, the next -- change becomes 0002 and this note goes away. CREATE TABLE workspace ( @@ -33,7 +33,7 @@ CREATE TABLE workspace ( -- `smtp_password` holds ciphertext, never the typed string. The server -- has to present the password to the mail host on every send, so a -- one-way hash is impossible; instead `store::secret` seals it under a - -- key kept in `izlek.key` beside this file, so a database copied for a + -- key kept in `iz.key` beside this file, so a database copied for a -- backup does not carry a working credential with it. No field on -- `Workspace` exposes it — it is written by `Store::set_sender` and read -- by `Store::smtp_password`, which only the mailer calls. @@ -54,7 +54,7 @@ CREATE TABLE workspace ( -- The address mail links point at, when the one the process was -- configured with is not the one people reach. A box behind a proxy -- answers on localhost and is known by a public name, and only an admin - -- knows which — so it is workspace content, and `config/izlek.toml`'s + -- knows which — so it is workspace content, and `config/iz.toml`'s -- `base_url` is what an empty one falls back to. public_url TEXT ); @@ -226,7 +226,7 @@ CREATE INDEX comment_by_task ON comment(task_id); -- Attachments live in the database file, not on disk beside it. -- --- Izlek is one process over one file, and a second place to keep state is a +-- Iz is one process over one file, and a second place to keep state is a -- second thing to back up, to lock, and to get out of step with the rows that -- name it. And a path is exactly where an uploaded file name must never end -- up: `../../etc` is a valid file name and a terrible path. Keeping the bytes diff --git a/crates/izlek-core/tests/fixtures/pre-collapse/0002_sender_check.sql b/crates/iz-core/tests/fixtures/pre-collapse/0002_sender_check.sql similarity index 100% rename from crates/izlek-core/tests/fixtures/pre-collapse/0002_sender_check.sql rename to crates/iz-core/tests/fixtures/pre-collapse/0002_sender_check.sql diff --git a/crates/izlek-core/tests/store.rs b/crates/iz-core/tests/store.rs similarity index 91% rename from crates/izlek-core/tests/store.rs rename to crates/iz-core/tests/store.rs index 7be840f..3c6a851 100644 --- a/crates/izlek-core/tests/store.rs +++ b/crates/iz-core/tests/store.rs @@ -1,4 +1,4 @@ -//! Integration tests for izlek-core: the storage boundary driven through the +//! Integration tests for iz-core: the storage boundary driven through the //! Turso implementation, and the account flows on top of it. //! //! New integration tests belong in this file rather than a new `tests/*.rs`: @@ -6,9 +6,9 @@ use std::path::PathBuf; -use izlek_core::Role; -use izlek_core::auth::{Token, hash_password}; -use izlek_core::store::{ +use iz_core::Role; +use iz_core::auth::{Token, hash_password}; +use iz_core::store::{ Audience, Event, MailOutcome, MailRule, NewAttachment, NewSender, NewUser, SendKind, SendState, Store, StoreError, Trigger, TursoStore, User, }; @@ -25,10 +25,10 @@ struct Scratch { impl Scratch { async fn open() -> Self { - let dir = std::env::temp_dir().join(format!("izlek-test-{}", Ulid::new())); + let dir = std::env::temp_dir().join(format!("iz-test-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); let storage = dir.join("storage"); - let store = TursoStore::open(dir.join("izlek.db").to_str().unwrap(), &storage) + let store = TursoStore::open(dir.join("iz.db").to_str().unwrap(), &storage) .await .unwrap(); Self { dir, storage, store } @@ -39,7 +39,7 @@ impl Scratch { /// need to see a column the way it actually sits on disk rather than through /// [`Store`]'s API. async fn raw_conn(scratch: &Scratch) -> turso::Connection { - let db = turso::Builder::new_local(scratch.dir.join("izlek.db").to_str().unwrap()) + let db = turso::Builder::new_local(scratch.dir.join("iz.db").to_str().unwrap()) .build() .await .unwrap(); @@ -57,8 +57,8 @@ async fn workspace_with_admin() -> (Scratch, String, String) { let (ws, admin) = scratch .store .claim_workspace( - "İzlek", - "ada@izlek.sh", + "İz", + "ada@iz.sh", "Ada", &hash_password("tide-tables-1892").unwrap(), ) @@ -72,8 +72,8 @@ async fn workspace_with_admin() -> (Scratch, String, String) { async fn claim(store: &TursoStore) -> (String, String) { let (ws, admin) = store .claim_workspace( - "İzlek", - "ada@izlek.sh", + "İz", + "ada@iz.sh", "Ada", &hash_password("tide-tables-1892").unwrap(), ) @@ -98,9 +98,9 @@ async fn member(store: &TursoStore, workspace_id: &str, email: &str, name: &str) #[tokio::test] async fn the_schema_is_created_once_and_survives_reopen() { - let dir = std::env::temp_dir().join(format!("izlek-test-{}", Ulid::new())); + let dir = std::env::temp_dir().join(format!("iz-test-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); - let path = dir.join("izlek.db").to_string_lossy().into_owned(); + let path = dir.join("iz.db").to_string_lossy().into_owned(); let first = TursoStore::open(&path, &dir.join("storage")).await.unwrap(); claim(&first).await; @@ -110,7 +110,7 @@ async fn the_schema_is_created_once_and_survives_reopen() { // schema (its CREATE TABLE would fail on the first one) and must not // lose what the first open wrote. let second = TursoStore::open(&path, &dir.join("storage")).await.unwrap(); - assert_eq!(second.workspace().await.unwrap().unwrap().name, "İzlek"); + assert_eq!(second.workspace().await.unwrap().unwrap().name, "İz"); drop(second); let _ = std::fs::remove_dir_all(&dir); } @@ -352,7 +352,7 @@ async fn a_parent_does_not_finish_before_its_subtasks_do() { !detail .activity .iter() - .any(|entry| matches!(entry.kind, izlek_core::detail::ActivityKind::Moved)), + .any(|entry| matches!(entry.kind, iz_core::detail::ActivityKind::Moved)), "a held move leaves no trail" ); @@ -476,7 +476,7 @@ async fn the_board_counts_subtasks_instead_of_carding_them() { let (parent, child) = a_parent_and_one_subtask(&scratch.store, &workspace, &admin).await; let board = load(&scratch.store, &workspace).await.unwrap().unwrap(); - let cards: Vec<&izlek_core::board::TaskCard> = + let cards: Vec<&iz_core::board::TaskCard> = board.columns.iter().flat_map(|c| &c.cards).collect(); assert_eq!(cards.len(), 1, "the subtask took a card of its own"); assert_eq!(cards[0].id, parent); @@ -681,7 +681,7 @@ async fn a_second_claim_loses_and_changes_nothing() { // The loser must not have joined as anything at all. assert_eq!( scratch.store.workspace().await.unwrap().unwrap().name, - "İzlek" + "İz" ); assert_eq!(scratch.store.count_users("").await.unwrap(), 0); let ws_id = scratch.store.workspace().await.unwrap().unwrap().id; @@ -698,9 +698,9 @@ 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-{}", Ulid::new())); + let dir = std::env::temp_dir().join(format!("iz-test-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); - let path = dir.join("izlek.db").to_string_lossy().into_owned(); + let path = dir.join("iz.db").to_string_lossy().into_owned(); let store = std::sync::Arc::new(TursoStore::open(&path, &dir.join("storage")).await.unwrap()); let hash = hash_password("tide-tables-1892").unwrap(); @@ -711,8 +711,8 @@ async fn concurrent_claims_produce_exactly_one_admin() { claims.push(tokio::spawn(async move { store .claim_workspace( - "İzlek", - &format!("claimant{i}@izlek.sh"), + "İz", + &format!("claimant{i}@iz.sh"), &format!("Claimant {i}"), &hash, ) @@ -751,9 +751,9 @@ 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-{}", Ulid::new())); + let dir = std::env::temp_dir().join(format!("iz-test-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); - let path = dir.join("izlek.db").to_string_lossy().into_owned(); + let path = dir.join("iz.db").to_string_lossy().into_owned(); let store = std::sync::Arc::new(TursoStore::open(&path, &dir.join("storage")).await.unwrap()); let (workspace_id, _) = claim(&store).await; @@ -791,8 +791,8 @@ async fn workspace_defaults_match_the_settings_screen() { let (ws, _) = scratch .store .claim_workspace( - "İzlek", - "ada@izlek.sh", + "İz", + "ada@iz.sh", "Ada", &hash_password("tide-tables-1892").unwrap(), ) @@ -828,10 +828,10 @@ async fn the_workspace_record_carries_the_sender_but_never_its_password() { NewSender { host: "smtp.fastmail.com".into(), port: 587, - username: "izlek".into(), + username: "iz".into(), password: Some("a-very-secret-string".into()), - from_name: "İzlek".into(), - from_address: "izlek@izlek.sh".into(), + from_name: "İz".into(), + from_address: "iz@iz.sh".into(), }, ) .await @@ -840,9 +840,9 @@ async fn the_workspace_record_carries_the_sender_but_never_its_password() { let ws = scratch.store.workspace().await.unwrap().unwrap(); assert_eq!(ws.smtp_host.as_deref(), Some("smtp.fastmail.com")); assert_eq!(ws.smtp_port, Some(587)); - assert_eq!(ws.smtp_username.as_deref(), Some("izlek")); - assert_eq!(ws.smtp_from_name.as_deref(), Some("İzlek")); - assert_eq!(ws.smtp_from_address.as_deref(), Some("izlek@izlek.sh")); + assert_eq!(ws.smtp_username.as_deref(), Some("iz")); + assert_eq!(ws.smtp_from_name.as_deref(), Some("İz")); + assert_eq!(ws.smtp_from_address.as_deref(), Some("iz@iz.sh")); assert!(ws.smtp_password_set, "the screen must be able to say 'set'"); let serialised = serde_json::to_string(&ws).unwrap(); @@ -861,10 +861,10 @@ async fn a_save_with_no_password_typed_keeps_the_stored_one() { let mut sender = NewSender { host: "smtp.fastmail.com".into(), port: 587, - username: "izlek".into(), + username: "iz".into(), password: Some("keep-me".into()), - from_name: "İzlek".into(), - from_address: "izlek@izlek.sh".into(), + from_name: "İz".into(), + from_address: "iz@iz.sh".into(), }; scratch .store @@ -898,10 +898,10 @@ async fn a_typed_password_replaces_the_stored_one() { let mut sender = NewSender { host: "smtp.fastmail.com".into(), port: 587, - username: "izlek".into(), + username: "iz".into(), password: Some("the-old-one".into()), - from_name: "İzlek".into(), - from_address: "izlek@izlek.sh".into(), + from_name: "İz".into(), + from_address: "iz@iz.sh".into(), }; scratch .store @@ -935,10 +935,10 @@ async fn the_stored_password_is_not_the_plaintext_on_disk() { NewSender { host: "smtp.fastmail.com".into(), port: 587, - username: "izlek".into(), + username: "iz".into(), password: Some("a-very-secret-string".into()), - from_name: "İzlek".into(), - from_address: "izlek@izlek.sh".into(), + from_name: "İz".into(), + from_address: "iz@iz.sh".into(), }, ) .await @@ -975,7 +975,7 @@ async fn the_stored_password_is_not_the_plaintext_on_disk() { ); } -/// A backup restored without its sibling `izlek.key`, or a key file damaged +/// A backup restored without its sibling `iz.key`, or a key file damaged /// in place, must not crash mail sending or the settings screen — it has to /// degrade to "no password set", exactly like a workspace that never had a /// sender, so the admin can heal it by retyping the password once. @@ -989,10 +989,10 @@ async fn a_password_that_will_not_decrypt_reads_back_as_none() { NewSender { host: "smtp.fastmail.com".into(), port: 587, - username: "izlek".into(), + username: "iz".into(), password: Some("a-very-secret-string".into()), - from_name: "İzlek".into(), - from_address: "izlek@izlek.sh".into(), + from_name: "İz".into(), + from_address: "iz@iz.sh".into(), }, ) .await @@ -1023,10 +1023,10 @@ async fn a_password_that_will_not_decrypt_reads_back_as_none() { NewSender { host: "smtp.fastmail.com".into(), port: 587, - username: "izlek".into(), + username: "iz".into(), password: Some("a-fresh-password".into()), - from_name: "İzlek".into(), - from_address: "izlek@izlek.sh".into(), + from_name: "İz".into(), + from_address: "iz@iz.sh".into(), }, ) .await @@ -1050,8 +1050,8 @@ async fn a_password_that_will_not_decrypt_reads_back_as_none() { async fn the_database_and_key_file_are_owner_only() { use std::os::unix::fs::PermissionsExt; let scratch = Scratch::open().await; - let db_path = scratch.dir.join("izlek.db"); - let key_path = scratch.dir.join("izlek.key"); + let db_path = scratch.dir.join("iz.db"); + let key_path = scratch.dir.join("iz.key"); for path in [&db_path, &key_path] { let mode = std::fs::metadata(path) .unwrap_or_else(|e| panic!("{}: {e}", path.display())) @@ -1094,7 +1094,7 @@ async fn an_invited_member_has_no_password_until_they_choose_one() { .store .create_user(NewUser { workspace_id: ws_id.clone(), - email: "grace@izlek.sh".into(), + email: "grace@iz.sh".into(), display_name: "Grace".into(), role: Role::Member, invited_by: None, @@ -1120,7 +1120,7 @@ async fn addresses_are_unique_and_case_insensitive() { .store .create_user(NewUser { workspace_id: ws_id.clone(), - email: " ADA@Izlek.sh ".into(), + email: " ADA@Iz.sh ".into(), display_name: "Ada again".into(), role: Role::Member, invited_by: None, @@ -1130,7 +1130,7 @@ async fn addresses_are_unique_and_case_insensitive() { assert!( scratch .store - .user_by_email(&ws_id, "Ada@IZLEK.sh") + .user_by_email(&ws_id, "Ada@IZ.sh") .await .unwrap() .is_some() @@ -1145,7 +1145,7 @@ async fn an_unknown_address_is_a_plain_none() { assert!( scratch .store - .user_by_email(&ws_id, "nobody@izlek.sh") + .user_by_email(&ws_id, "nobody@iz.sh") .await .unwrap() .is_none() @@ -1156,8 +1156,8 @@ async fn an_unknown_address_is_a_plain_none() { async fn members_list_and_count_for_the_admin_screen() { let (scratch, ws_id, admin_id) = workspace_with_admin().await; for (email, name, role) in [ - ("grace@izlek.sh", "Grace", Role::Member), - ("linus@izlek.sh", "Linus", Role::Viewer), + ("grace@iz.sh", "Grace", Role::Member), + ("linus@iz.sh", "Linus", Role::Viewer), ] { scratch .store @@ -1184,7 +1184,7 @@ async fn profile_and_role_updates_stick() { .store .create_user(NewUser { workspace_id: ws_id, - email: "grace@izlek.sh".into(), + email: "grace@iz.sh".into(), display_name: "Grace".into(), role: Role::Member, invited_by: None, @@ -1238,29 +1238,29 @@ async fn profile_and_role_updates_stick() { #[tokio::test] async fn email_change_persists_and_refuses_a_taken_address() { - let dir = std::env::temp_dir().join(format!("izlek-test-{}", Ulid::new())); + let dir = std::env::temp_dir().join(format!("iz-test-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); - let path = dir.join("izlek.db").to_str().unwrap().to_string(); + let path = dir.join("iz.db").to_str().unwrap().to_string(); let user_id = { let store = TursoStore::open(&path, &dir.join("storage")).await.unwrap(); let (ws_id, _admin_id) = claim(&store).await; - let user_id = member(&store, &ws_id, "grace@izlek.sh", "Grace").await; + let user_id = member(&store, &ws_id, "grace@iz.sh", "Grace").await; store - .set_email(&user_id, &ws_id, "Grace.New@Izlek.sh") + .set_email(&user_id, &ws_id, "Grace.New@Iz.sh") .await .unwrap(); // Case-folded the same way sign-in matches an address. assert!( store - .user_by_email(&ws_id, "grace.new@izlek.sh") + .user_by_email(&ws_id, "grace.new@iz.sh") .await .unwrap() .is_some() ); assert!( store - .user_by_email(&ws_id, "grace@izlek.sh") + .user_by_email(&ws_id, "grace@iz.sh") .await .unwrap() .is_none() @@ -1268,7 +1268,7 @@ async fn email_change_persists_and_refuses_a_taken_address() { // Taken by the admin already claimed above. let err = store - .set_email(&user_id, &ws_id, "ada@izlek.sh") + .set_email(&user_id, &ws_id, "ada@iz.sh") .await .unwrap_err(); assert!(matches!(err, StoreError::Conflict("account"))); @@ -1278,16 +1278,16 @@ async fn email_change_persists_and_refuses_a_taken_address() { // Persists across a reopen, and the refused attempt did not stick. let store = TursoStore::open(&path, &dir.join("storage")).await.unwrap(); let user = store.user(&user_id).await.unwrap().unwrap(); - assert_eq!(user.email, "grace.new@izlek.sh"); + assert_eq!(user.email, "grace.new@iz.sh"); let _ = std::fs::remove_dir_all(&dir); } #[tokio::test] async fn display_preferences_default_and_persist_across_reopen() { - let dir = std::env::temp_dir().join(format!("izlek-test-{}", Ulid::new())); + let dir = std::env::temp_dir().join(format!("iz-test-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); - let path = dir.join("izlek.db").to_string_lossy().into_owned(); + let path = dir.join("iz.db").to_string_lossy().into_owned(); let store = TursoStore::open(&path, &dir.join("storage")).await.unwrap(); let (_, admin_id) = claim(&store).await; @@ -1336,7 +1336,7 @@ async fn a_signin_link_stores_only_the_hash_and_is_used_once() { .store .create_user(NewUser { workspace_id: ws_id, - email: "grace@izlek.sh".into(), + email: "grace@iz.sh".into(), display_name: "Grace".into(), role: Role::Member, invited_by: None, @@ -1351,7 +1351,7 @@ async fn a_signin_link_stores_only_the_hash_and_is_used_once() { &user.id, "hash-of-the-token", now + Duration::days(7), - izlek_core::store::LinkKind::Join, + iz_core::store::LinkKind::Join, ) .await .unwrap(); @@ -1406,7 +1406,7 @@ async fn an_expired_link_is_still_a_live_account() { .store .create_user(NewUser { workspace_id: ws_id, - email: "grace@izlek.sh".into(), + email: "grace@iz.sh".into(), display_name: "Grace".into(), role: Role::Member, invited_by: None, @@ -1421,7 +1421,7 @@ async fn an_expired_link_is_still_a_live_account() { &user.id, "stale-hash", now - Duration::hours(1), - izlek_core::store::LinkKind::Join, + iz_core::store::LinkKind::Join, ) .await .unwrap(); @@ -1434,7 +1434,7 @@ async fn an_expired_link_is_still_a_live_account() { &user.id, "fresh-hash", now + Duration::days(7), - izlek_core::store::LinkKind::Join, + iz_core::store::LinkKind::Join, ) .await .unwrap(); @@ -1448,7 +1448,7 @@ async fn the_store_is_usable_behind_a_trait_object() { let scratch = Scratch::open().await; let store: &dyn Store = &scratch.store; store - .claim_workspace("İzlek", "ada@izlek.sh", "Ada", "$argon2id$fake") + .claim_workspace("İz", "ada@iz.sh", "Ada", "$argon2id$fake") .await .unwrap(); assert!(store.workspace().await.unwrap().is_some()); @@ -1456,12 +1456,12 @@ 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-{}", Ulid::new())); + let dir = std::env::temp_dir().join(format!("iz-test-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); - let path = dir.join("izlek.db").to_string_lossy().into_owned(); + let path = dir.join("iz.db").to_string_lossy().into_owned(); let store = std::sync::Arc::new(TursoStore::open(&path, &dir.join("storage")).await.unwrap()); let (ws_id, _) = claim(&store).await; - let user_id = member(&store, &ws_id, "grace@izlek.sh", "Grace").await; + let user_id = member(&store, &ws_id, "grace@iz.sh", "Grace").await; let token = Token::mint(); let now = OffsetDateTime::now_utc(); @@ -1470,7 +1470,7 @@ async fn a_prefetched_link_is_consumed_exactly_once() { &user_id, &token.hash(), now + Duration::days(7), - izlek_core::store::LinkKind::Join, + iz_core::store::LinkKind::Join, ) .await .unwrap(); @@ -1499,7 +1499,7 @@ async fn a_prefetched_link_is_consumed_exactly_once() { #[tokio::test] async fn a_session_lives_until_it_expires_or_is_revoked() { let (scratch, ws_id, _) = workspace_with_admin().await; - let user_id = member(&scratch.store, &ws_id, "grace@izlek.sh", "Grace").await; + let user_id = member(&scratch.store, &ws_id, "grace@iz.sh", "Grace").await; let token = Token::mint(); let now = OffsetDateTime::now_utc(); @@ -1554,7 +1554,7 @@ async fn a_session_lives_until_it_expires_or_is_revoked() { #[tokio::test] async fn an_expired_session_is_not_live() { let (scratch, ws_id, _) = workspace_with_admin().await; - let user_id = member(&scratch.store, &ws_id, "grace@izlek.sh", "Grace").await; + let user_id = member(&scratch.store, &ws_id, "grace@iz.sh", "Grace").await; let now = OffsetDateTime::now_utc(); let session = scratch .store @@ -1567,8 +1567,8 @@ async fn an_expired_session_is_not_live() { #[tokio::test] async fn changing_a_password_can_sign_out_every_other_device() { let (scratch, ws_id, _) = workspace_with_admin().await; - let user_id = member(&scratch.store, &ws_id, "grace@izlek.sh", "Grace").await; - let other_id = member(&scratch.store, &ws_id, "linus@izlek.sh", "Linus").await; + let user_id = member(&scratch.store, &ws_id, "grace@iz.sh", "Grace").await; + let other_id = member(&scratch.store, &ws_id, "linus@iz.sh", "Linus").await; let now = OffsetDateTime::now_utc(); let mut hashes = Vec::new(); @@ -1617,7 +1617,7 @@ async fn auth_attempts_are_counted_over_a_window() { for minutes_ago in [30, 20, 10, 5, 1] { scratch .store - .record_auth_attempt("grace@izlek.sh", now - Duration::minutes(minutes_ago)) + .record_auth_attempt("grace@iz.sh", now - Duration::minutes(minutes_ago)) .await .unwrap(); } @@ -1631,7 +1631,7 @@ async fn auth_attempts_are_counted_over_a_window() { assert_eq!( scratch .store - .count_auth_attempts("grace@izlek.sh", window) + .count_auth_attempts("grace@iz.sh", window) .await .unwrap(), 3 @@ -1647,7 +1647,7 @@ async fn auth_attempts_are_counted_over_a_window() { assert_eq!( scratch .store - .count_auth_attempts("nobody@izlek.sh", window) + .count_auth_attempts("nobody@iz.sh", window) .await .unwrap(), 0 @@ -1656,13 +1656,13 @@ async fn auth_attempts_are_counted_over_a_window() { // A success clears the bucket that succeeded, and only that one. scratch .store - .clear_auth_attempts("grace@izlek.sh") + .clear_auth_attempts("grace@iz.sh") .await .unwrap(); assert_eq!( scratch .store - .count_auth_attempts("grace@izlek.sh", window) + .count_auth_attempts("grace@iz.sh", window) .await .unwrap(), 0 @@ -1679,7 +1679,7 @@ async fn auth_attempts_are_counted_over_a_window() { // Pruning drops what is out of every window. scratch .store - .record_auth_attempt("grace@izlek.sh", now - Duration::hours(2)) + .record_auth_attempt("grace@iz.sh", now - Duration::hours(2)) .await .unwrap(); let pruned = scratch @@ -1694,8 +1694,8 @@ async fn auth_attempts_are_counted_over_a_window() { // Account flows. // --------------------------------------------------------------------------- -use izlek_core::accounts::{AccountError, Accounts, RATE_LIMIT, SIGNIN_LINK_LIFETIME}; -use izlek_core::auth::PasswordProblem; +use iz_core::accounts::{AccountError, Accounts, RATE_LIMIT, SIGNIN_LINK_LIFETIME}; +use iz_core::auth::PasswordProblem; use std::sync::Arc; /// An accounts service over a throwaway database. The directory is kept alive @@ -1703,19 +1703,19 @@ use std::sync::Arc; async fn accounts() -> (Scratch, Accounts) { let scratch = Scratch::open().await; let store = TursoStore::open( - scratch.dir.join("izlek.db").to_str().unwrap(), + scratch.dir.join("iz.db").to_str().unwrap(), &scratch.dir.join("storage"), ) .await .unwrap(); - let accounts = Accounts::new(Arc::new(store) as Arc, "https://izlek.sh"); + let accounts = Accounts::new(Arc::new(store) as Arc, "https://iz.sh"); (scratch, accounts) } async fn claimed() -> (Scratch, Accounts, User) { let (scratch, accounts) = accounts().await; let (_, signed_in) = accounts - .claim_workspace("İzlek", "ada@izlek.sh", "Ada", "tide-tables-1892") + .claim_workspace("İz", "ada@iz.sh", "Ada", "tide-tables-1892") .await .unwrap(); (scratch, accounts, signed_in.user) @@ -1725,10 +1725,10 @@ async fn claimed() -> (Scratch, Accounts, User) { async fn claiming_makes_an_admin_and_signs_them_in() { let (_scratch, accounts) = accounts().await; let (workspace, signed_in) = accounts - .claim_workspace("İzlek", "ada@izlek.sh", "Ada", "tide-tables-1892") + .claim_workspace("İz", "ada@iz.sh", "Ada", "tide-tables-1892") .await .unwrap(); - assert_eq!(workspace.name, "İzlek"); + assert_eq!(workspace.name, "İz"); assert_eq!(signed_in.user.role, Role::Admin); assert!( signed_in.user.last_signed_in_at.is_some(), @@ -1755,7 +1755,7 @@ async fn claiming_makes_an_admin_and_signs_them_in() { async fn the_claim_screen_enforces_its_own_password_rules() { let (_scratch, accounts) = accounts().await; let too_short = accounts - .claim_workspace("İzlek", "ada@izlek.sh", "Ada", "short") + .claim_workspace("İz", "ada@iz.sh", "Ada", "short") .await; assert!(matches!( too_short, @@ -1783,7 +1783,7 @@ async fn a_second_claim_is_refused() { async fn an_invited_member_chooses_their_own_password() { let (_scratch, accounts, admin) = claimed().await; let invitation = accounts - .invite(&admin, "grace@izlek.sh", "Grace", Role::Member) + .invite(&admin, "grace@iz.sh", "Grace", Role::Member) .await .unwrap(); assert!(!invitation.user.has_signed_in(), "no password yet"); @@ -1794,7 +1794,7 @@ async fn an_invited_member_chooses_their_own_password() { // The admin cannot sign in as them in the meantime. let as_them = accounts - .sign_in("grace@izlek.sh", "tide-tables-1892", "198.51.100.7") + .sign_in("grace@iz.sh", "tide-tables-1892", "198.51.100.7") .await; assert!(matches!(as_them, Err(AccountError::Rejected))); @@ -1815,7 +1815,7 @@ async fn an_invited_member_chooses_their_own_password() { // And now the password they chose works, and only that one. accounts - .sign_in("grace@izlek.sh", "sextant-and-chart", "198.51.100.7") + .sign_in("grace@iz.sh", "sextant-and-chart", "198.51.100.7") .await .unwrap(); } @@ -1824,22 +1824,22 @@ async fn an_invited_member_chooses_their_own_password() { async fn adding_a_member_queues_the_mail_that_carries_the_link() { let (_scratch, accounts, admin) = claimed().await; let invitation = accounts - .invite(&admin, "grace@izlek.sh", "Grace", Role::Member) + .invite(&admin, "grace@iz.sh", "Grace", Role::Member) .await .unwrap(); let queue = accounts .store() - .mail_queue(10, izlek_core::store::FeedPage::Newest) + .mail_queue(10, iz_core::store::FeedPage::Newest) .await .unwrap(); let queued = queue .iter() - .find(|s| s.recipient == "grace@izlek.sh") + .find(|s| s.recipient == "grace@iz.sh") .expect("the invite mail is on the outbox"); assert_eq!(queued.kind, SendKind::Invite); let body = queued.body.as_deref().unwrap(); - let link = format!("https://izlek.sh/join/{}", invitation.token.expose()); + let link = format!("https://iz.sh/join/{}", invitation.token.expose()); assert!(body.contains(&link), "body was: {body}"); } @@ -1847,7 +1847,7 @@ async fn adding_a_member_queues_the_mail_that_carries_the_link() { async fn only_an_admin_may_invite() { let (_scratch, accounts, admin) = claimed().await; let invitation = accounts - .invite(&admin, "grace@izlek.sh", "Grace", Role::Member) + .invite(&admin, "grace@iz.sh", "Grace", Role::Member) .await .unwrap(); let member = accounts @@ -1862,7 +1862,7 @@ async fn only_an_admin_may_invite() { // Server-side, not merely hidden: a member calling the flow is refused. let attempt = accounts - .invite(&member, "linus@izlek.sh", "Linus", Role::Member) + .invite(&member, "linus@iz.sh", "Linus", Role::Member) .await; assert!(matches!(attempt, Err(AccountError::Forbidden))); @@ -1870,7 +1870,7 @@ async fn only_an_admin_may_invite() { viewer.role = Role::Viewer; assert!(matches!( accounts - .invite(&viewer, "linus@izlek.sh", "Linus", Role::Viewer) + .invite(&viewer, "linus@iz.sh", "Linus", Role::Viewer) .await, Err(AccountError::Forbidden) )); @@ -1880,7 +1880,7 @@ async fn only_an_admin_may_invite() { async fn an_admin_may_change_a_members_role() { let (_scratch, accounts, admin) = claimed().await; let invitation = accounts - .invite(&admin, "grace@izlek.sh", "Grace", Role::Member) + .invite(&admin, "grace@iz.sh", "Grace", Role::Member) .await .unwrap(); @@ -1902,7 +1902,7 @@ async fn an_admin_may_change_a_members_role() { async fn the_owner_may_not_have_their_role_changed_even_by_another_admin() { let (_scratch, accounts, admin) = claimed().await; let invitation = accounts - .invite(&admin, "grace@izlek.sh", "Grace", Role::Admin) + .invite(&admin, "grace@iz.sh", "Grace", Role::Admin) .await .unwrap(); let other_admin = accounts @@ -1928,7 +1928,7 @@ async fn the_owner_may_not_have_their_role_changed_even_by_another_admin() { async fn nobody_may_change_their_own_role() { let (_scratch, accounts, admin) = claimed().await; let invitation = accounts - .invite(&admin, "grace@izlek.sh", "Grace", Role::Member) + .invite(&admin, "grace@iz.sh", "Grace", Role::Member) .await .unwrap(); let member = accounts @@ -1949,7 +1949,7 @@ async fn nobody_may_change_their_own_role() { async fn a_link_works_once_and_a_wrong_one_never_does() { let (_scratch, accounts, admin) = claimed().await; let invitation = accounts - .invite(&admin, "grace@izlek.sh", "Grace", Role::Member) + .invite(&admin, "grace@iz.sh", "Grace", Role::Member) .await .unwrap(); @@ -1977,7 +1977,7 @@ async fn a_link_works_once_and_a_wrong_one_never_does() { // The password they actually set is untouched by either failure. accounts - .sign_in("grace@izlek.sh", "sextant-and-chart", "198.51.100.7") + .sign_in("grace@iz.sh", "sextant-and-chart", "198.51.100.7") .await .unwrap(); } @@ -1986,7 +1986,7 @@ async fn a_link_works_once_and_a_wrong_one_never_does() { async fn a_rejected_password_does_not_burn_the_invitation() { let (_scratch, accounts, admin) = claimed().await; let invitation = accounts - .invite(&admin, "grace@izlek.sh", "Grace", Role::Member) + .invite(&admin, "grace@iz.sh", "Grace", Role::Member) .await .unwrap(); @@ -2021,7 +2021,7 @@ async fn a_rejected_password_does_not_burn_the_invitation() { async fn an_expired_link_is_refused_and_resending_opens_the_same_account() { let (_scratch, accounts, admin) = claimed().await; let invitation = accounts - .invite(&admin, "grace@izlek.sh", "Grace", Role::Member) + .invite(&admin, "grace@iz.sh", "Grace", Role::Member) .await .unwrap(); @@ -2033,7 +2033,7 @@ async fn an_expired_link_is_refused_and_resending_opens_the_same_account() { &invitation.user.id, &stale.hash(), OffsetDateTime::now_utc() - Duration::minutes(1), - izlek_core::store::LinkKind::Join, + iz_core::store::LinkKind::Join, ) .await .unwrap(); @@ -2060,10 +2060,10 @@ async fn an_expired_link_is_refused_and_resending_opens_the_same_account() { async fn an_unknown_address_and_a_wrong_password_are_indistinguishable() { let (_scratch, accounts, _admin) = claimed().await; let unknown = accounts - .sign_in("nobody@izlek.sh", "tide-tables-1892", "198.51.100.7") + .sign_in("nobody@iz.sh", "tide-tables-1892", "198.51.100.7") .await; let wrong = accounts - .sign_in("ada@izlek.sh", "not-her-password", "198.51.100.8") + .sign_in("ada@iz.sh", "not-her-password", "198.51.100.8") .await; assert!(matches!(unknown, Err(AccountError::Rejected))); assert!(matches!(wrong, Err(AccountError::Rejected))); @@ -2082,13 +2082,13 @@ async fn the_miss_path_costs_what_the_hit_path_costs() { // which a skipped verify could not. let baseline = std::time::Instant::now(); let _ = accounts - .sign_in("ada@izlek.sh", "not-her-password", "198.51.100.7") + .sign_in("ada@iz.sh", "not-her-password", "198.51.100.7") .await; let hit_cost = baseline.elapsed(); let started = std::time::Instant::now(); let _ = accounts - .sign_in("nobody@izlek.sh", "not-a-password", "198.51.100.8") + .sign_in("nobody@iz.sh", "not-a-password", "198.51.100.8") .await; let miss_cost = started.elapsed(); @@ -2102,12 +2102,12 @@ async fn the_miss_path_costs_what_the_hit_path_costs() { async fn an_invited_account_that_has_no_password_cannot_be_signed_into() { let (_scratch, accounts, admin) = claimed().await; accounts - .invite(&admin, "grace@izlek.sh", "Grace", Role::Member) + .invite(&admin, "grace@iz.sh", "Grace", Role::Member) .await .unwrap(); // Not "set your password first" — that would confirm the address exists. assert!(matches!( - accounts.sign_in("grace@izlek.sh", "", "198.51.100.7").await, + accounts.sign_in("grace@iz.sh", "", "198.51.100.7").await, Err(AccountError::Rejected) )); } @@ -2117,20 +2117,20 @@ async fn sign_in_attempts_are_rate_limited_per_address() { let (_scratch, accounts, _admin) = claimed().await; for _ in 0..RATE_LIMIT { let _ = accounts - .sign_in("ada@izlek.sh", "wrong", "198.51.100.7") + .sign_in("ada@iz.sh", "wrong", "198.51.100.7") .await; } // The next attempt is refused before any Argon2 work happens. assert!(matches!( accounts - .sign_in("ada@izlek.sh", "wrong", "203.0.113.9") + .sign_in("ada@iz.sh", "wrong", "203.0.113.9") .await, Err(AccountError::RateLimited) )); // A different address from a fresh client is unaffected. assert!(matches!( accounts - .sign_in("someone@izlek.sh", "wrong", "203.0.113.9") + .sign_in("someone@iz.sh", "wrong", "203.0.113.9") .await, Err(AccountError::Rejected) )); @@ -2146,12 +2146,12 @@ async fn a_flooded_address_never_locks_the_owner_out() { // Each guess from its own client, so only the address bucket fills. for i in 0..(RATE_LIMIT + 5) { let _ = accounts - .sign_in("ada@izlek.sh", "wrong", &format!("203.0.113.{i}")) + .sign_in("ada@iz.sh", "wrong", &format!("203.0.113.{i}")) .await; } // The owner, from a client of their own, still gets in. accounts - .sign_in("ada@izlek.sh", "tide-tables-1892", "198.51.100.7") + .sign_in("ada@iz.sh", "tide-tables-1892", "198.51.100.7") .await .unwrap(); } @@ -2162,13 +2162,13 @@ async fn sign_in_attempts_are_rate_limited_per_client() { let (_scratch, accounts, _admin) = claimed().await; for i in 0..RATE_LIMIT { let _ = accounts - .sign_in(&format!("nobody{i}@izlek.sh"), "wrong", "203.0.113.9") + .sign_in(&format!("nobody{i}@iz.sh"), "wrong", "203.0.113.9") .await; } // Refused before any Argon2 work, whatever address it asks about. assert!(matches!( accounts - .sign_in("ada@izlek.sh", "tide-tables-1892", "203.0.113.9") + .sign_in("ada@iz.sh", "tide-tables-1892", "203.0.113.9") .await, Err(AccountError::RateLimited) )); @@ -2181,7 +2181,7 @@ async fn sign_in_attempts_are_rate_limited_per_client() { async fn link_redemption_is_rate_limited_per_client() { let (_scratch, accounts, admin) = claimed().await; let invitation = accounts - .invite(&admin, "grace@izlek.sh", "Grace", Role::Member) + .invite(&admin, "grace@iz.sh", "Grace", Role::Member) .await .unwrap(); for i in 0..RATE_LIMIT { @@ -2243,17 +2243,17 @@ async fn a_successful_sign_in_clears_the_bucket() { let (_scratch, accounts, _admin) = claimed().await; for _ in 0..(RATE_LIMIT - 1) { let _ = accounts - .sign_in("ada@izlek.sh", "wrong", "198.51.100.7") + .sign_in("ada@iz.sh", "wrong", "198.51.100.7") .await; } accounts - .sign_in("ada@izlek.sh", "tide-tables-1892", "198.51.100.7") + .sign_in("ada@iz.sh", "tide-tables-1892", "198.51.100.7") .await .unwrap(); // Someone who mistypes and then gets it right is not left at the edge. assert!(matches!( accounts - .sign_in("ada@izlek.sh", "wrong", "198.51.100.7") + .sign_in("ada@iz.sh", "wrong", "198.51.100.7") .await, Err(AccountError::Rejected) )); @@ -2263,11 +2263,11 @@ async fn a_successful_sign_in_clears_the_bucket() { async fn changing_a_password_signs_out_every_device() { let (_scratch, accounts, admin) = claimed().await; let first = accounts - .sign_in("ada@izlek.sh", "tide-tables-1892", "198.51.100.7") + .sign_in("ada@iz.sh", "tide-tables-1892", "198.51.100.7") .await .unwrap(); let second = accounts - .sign_in("ada@izlek.sh", "tide-tables-1892", "198.51.100.8") + .sign_in("ada@iz.sh", "tide-tables-1892", "198.51.100.8") .await .unwrap(); assert!( @@ -2320,7 +2320,7 @@ async fn changing_a_password_signs_out_every_device() { .is_some() ); accounts - .sign_in("ada@izlek.sh", "chronometer-1761", "198.51.100.7") + .sign_in("ada@iz.sh", "chronometer-1761", "198.51.100.7") .await .unwrap(); } @@ -2342,7 +2342,7 @@ async fn changing_a_password_needs_the_current_one_and_obeys_the_rules() { )); // The old password still works after both refusals. accounts - .sign_in("ada@izlek.sh", "tide-tables-1892", "198.51.100.7") + .sign_in("ada@iz.sh", "tide-tables-1892", "198.51.100.7") .await .unwrap(); } @@ -2361,12 +2361,12 @@ async fn the_old_password_stops_working_after_a_change() { .unwrap(); assert!(matches!( accounts - .sign_in("ada@izlek.sh", "tide-tables-1892", "198.51.100.7") + .sign_in("ada@iz.sh", "tide-tables-1892", "198.51.100.7") .await, Err(AccountError::Rejected) )); accounts - .sign_in("ada@izlek.sh", "chronometer-1761", "198.51.100.7") + .sign_in("ada@iz.sh", "chronometer-1761", "198.51.100.7") .await .unwrap(); } @@ -2375,11 +2375,11 @@ async fn the_old_password_stops_working_after_a_change() { async fn signing_out_ends_that_browser_only() { let (_scratch, accounts, _admin) = claimed().await; let laptop = accounts - .sign_in("ada@izlek.sh", "tide-tables-1892", "198.51.100.7") + .sign_in("ada@iz.sh", "tide-tables-1892", "198.51.100.7") .await .unwrap(); let phone = accounts - .sign_in("ada@izlek.sh", "tide-tables-1892", "198.51.100.8") + .sign_in("ada@iz.sh", "tide-tables-1892", "198.51.100.8") .await .unwrap(); @@ -2409,18 +2409,18 @@ async fn signing_out_ends_that_browser_only() { async fn an_address_can_only_be_invited_once() { let (_scratch, accounts, admin) = claimed().await; accounts - .invite(&admin, "grace@izlek.sh", "Grace", Role::Member) + .invite(&admin, "grace@iz.sh", "Grace", Role::Member) .await .unwrap(); assert!(matches!( accounts - .invite(&admin, "GRACE@izlek.sh", "Grace again", Role::Member) + .invite(&admin, "GRACE@iz.sh", "Grace again", Role::Member) .await, Err(AccountError::AddressTaken) )); assert!(matches!( accounts - .invite(&admin, "ada@izlek.sh", "Ada again", Role::Member) + .invite(&admin, "ada@iz.sh", "Ada again", Role::Member) .await, Err(AccountError::AddressTaken) )); @@ -2428,8 +2428,8 @@ async fn an_address_can_only_be_invited_once() { // -- board ------------------------------------------------------------------ -use izlek_core::board::{BoardReads, BoardView, Moved, Person, load}; -use izlek_core::store::NewTask; +use iz_core::board::{BoardReads, BoardView, Moved, Person, load}; +use iz_core::store::NewTask; use std::sync::atomic::{AtomicUsize, Ordering}; use time::Date; use time::macros::date; @@ -2466,12 +2466,12 @@ impl BoardReads for CountingReads<'_> { async fn board( &self, workspace_id: &str, - ) -> Result, StoreError> { + ) -> Result, StoreError> { self.tick(); self.inner.board(workspace_id).await } - async fn columns(&self, board_id: &str) -> Result, StoreError> { + async fn columns(&self, board_id: &str) -> Result, StoreError> { self.tick(); self.inner.columns(board_id).await } @@ -2479,7 +2479,7 @@ impl BoardReads for CountingReads<'_> { async fn tasks_for_board( &self, board_id: &str, - ) -> Result, StoreError> { + ) -> Result, StoreError> { self.tick(); self.inner.tasks_for_board(board_id).await } @@ -2559,18 +2559,18 @@ async fn add_task( /// covers exactly the filtered set — no row skipped or repeated. #[tokio::test] async fn count_and_filtered_keyset_walk_cover_exactly_the_filtered_set() { - use izlek_core::store::{ActivityFilter, Dir, FeedCursor, FeedPage}; + use iz_core::store::{ActivityFilter, Dir, FeedCursor, FeedPage}; let (scratch, workspace, admin) = workspace_with_admin().await; let store = &scratch.store; - let other = member(store, &workspace, "sam@izlek.sh", "Sam").await; + let other = member(store, &workspace, "sam@iz.sh", "Sam").await; let t0 = OffsetDateTime::now_utc(); for i in 0..20 { let actor = if i % 2 == 0 { &admin } else { &other }; store .record_event( Some(actor), - &izlek_core::detail::ActivityKind::Other("row".to_string()), + &iz_core::detail::ActivityKind::Other("row".to_string()), &format!("row {i}"), t0 + Duration::seconds(i), ) @@ -2687,7 +2687,7 @@ async fn a_card_carries_its_assignees_comments_and_dependency_keys() { let mel = store .create_user(NewUser { workspace_id: workspace.clone(), - email: "mel@izlek.sh".into(), + email: "mel@iz.sh".into(), display_name: "Mel Duarte".into(), role: Role::Member, invited_by: None, @@ -2982,14 +2982,14 @@ async fn a_boards_tags_have_unique_names() { )); } -fn tag_order(tags: &[izlek_core::store::Tag]) -> Vec<&str> { +fn tag_order(tags: &[iz_core::store::Tag]) -> Vec<&str> { tags.iter().map(|t| t.name.as_str()).collect() } fn card_of<'a>( - view: &'a izlek_core::board::BoardView, + view: &'a iz_core::board::BoardView, task: &str, -) -> &'a izlek_core::board::TaskCard { +) -> &'a iz_core::board::TaskCard { view.columns .iter() .flat_map(|column| column.cards.iter()) @@ -3222,7 +3222,7 @@ fn initials_fall_back_to_two_letters() { // -- task detail ------------------------------------------------------------ -use izlek_core::detail::{ +use iz_core::detail::{ ActivityEntry, ActivityKind, Comment, DependencyEdge, DetailReads, TaskFacts, load as load_detail, }; @@ -3261,7 +3261,7 @@ impl DetailReads for CountingDetail<'_> { async fn columns_for_board( &self, board_id: &str, - ) -> Result, StoreError> { + ) -> Result, StoreError> { self.tick(); self.inner.columns_for_board(board_id).await } @@ -3292,7 +3292,7 @@ impl DetailReads for CountingDetail<'_> { async fn files_for_task( &self, task_id: &str, - ) -> Result, StoreError> { + ) -> Result, StoreError> { self.tick(); self.inner.files_for_task(task_id).await } @@ -3305,7 +3305,7 @@ impl DetailReads for CountingDetail<'_> { async fn family_for_task( &self, task_id: &str, - ) -> Result, StoreError> { + ) -> Result, StoreError> { self.tick(); self.inner.family_for_task(task_id).await } @@ -3353,7 +3353,7 @@ async fn a_viewer_is_never_offered_as_an_assignee() { let quiet = store .create_user(NewUser { workspace_id: workspace.clone(), - email: "quiet@izlek.sh".into(), + email: "quiet@iz.sh".into(), display_name: "Quiet Reader".into(), role: Role::Viewer, invited_by: None, @@ -3647,7 +3647,7 @@ async fn a_task_detail_costs_nine_queries_whatever_it_carries() { let person = store .create_user(NewUser { workspace_id: workspace.clone(), - email: format!("member{n}@izlek.sh"), + email: format!("member{n}@iz.sh"), display_name: format!("Member {n}"), role: Role::Member, invited_by: None, @@ -3972,7 +3972,7 @@ async fn an_orphan_row_is_refused() { .store .create_user(NewUser { workspace_id: "no-such-workspace".into(), - email: "orphan@izlek.sh".into(), + email: "orphan@iz.sh".into(), display_name: "Orphan".into(), role: Role::Member, invited_by: None, @@ -3995,9 +3995,9 @@ 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-{}", Ulid::new())); + let dir = std::env::temp_dir().join(format!("iz-fk-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); - let path = dir.join("izlek.db").to_str().unwrap().to_owned(); + let path = dir.join("iz.db").to_str().unwrap().to_owned(); { TursoStore::open(&path, &dir.join("storage")).await.unwrap(); } @@ -4017,7 +4017,7 @@ async fn an_orphan_row_is_refused() { let refused = conn .execute( "INSERT INTO user (id, workspace_id, email, display_name, role, created_at) \ - VALUES ('u-orphan', 'no-such-workspace', 'orphan@izlek.sh', 'Orphan', \ + VALUES ('u-orphan', 'no-such-workspace', 'orphan@iz.sh', 'Orphan', \ 'member', '2026-08-26')", (), ) @@ -4038,7 +4038,7 @@ async fn moved_to( from: &str, to: &str, actor: &str, -) -> izlek_core::board::Transition { +) -> iz_core::board::Transition { let from_id = column_named(store, workspace, from).await; let to_id = column_named(store, workspace, to).await; match store @@ -4073,9 +4073,9 @@ async fn a_rule_naming_a_column_it_cannot_act_on_is_refused_by_the_schema() { // past it, straight at the table. The check constraint is the guard: a // column on a trigger that never reads one is a rule whose author meant // something the engine will not do. - let dir = std::env::temp_dir().join(format!("izlek-test-{}", Ulid::new())); + let dir = std::env::temp_dir().join(format!("iz-test-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); - let path = dir.join("izlek.db").to_string_lossy().into_owned(); + let path = dir.join("iz.db").to_string_lossy().into_owned(); let store = TursoStore::open(&path, &dir.join("storage")).await.unwrap(); let (workspace, _admin) = claim(&store).await; let board = store.board(&workspace).await.unwrap().unwrap(); @@ -4220,7 +4220,7 @@ async fn the_index_decides_who_owns_a_send() { let now = OffsetDateTime::now_utc(); let first = scratch .store - .claim_send(&rule.id, &transition.id, &task, "ada@izlek.sh", now, now) + .claim_send(&rule.id, &transition.id, &task, "ada@iz.sh", now, now) .await .unwrap(); assert!(first.is_some(), "the first run owns the send"); @@ -4230,7 +4230,7 @@ async fn the_index_decides_who_owns_a_send() { // first: the insert loses. let second = scratch .store - .claim_send(&rule.id, &transition.id, &task, "ada@izlek.sh", now, now) + .claim_send(&rule.id, &transition.id, &task, "ada@iz.sh", now, now) .await .unwrap(); assert!(second.is_none(), "the second run owns nothing"); @@ -4266,7 +4266,7 @@ async fn a_second_crossing_is_a_second_send() { assert!( scratch .store - .claim_send(&rule.id, &transition.id, &task, "ada@izlek.sh", now, now) + .claim_send(&rule.id, &transition.id, &task, "ada@iz.sh", now, now) .await .unwrap() .is_some() @@ -4300,7 +4300,7 @@ async fn a_refused_send_is_recorded_and_owed_again() { let now = OffsetDateTime::now_utc(); let send = scratch .store - .claim_send(&rule.id, &transition.id, &task, "ada@izlek.sh", now, now) + .claim_send(&rule.id, &transition.id, &task, "ada@iz.sh", now, now) .await .unwrap() .unwrap(); @@ -4353,7 +4353,7 @@ async fn a_refused_address_is_not_retried_forever() { let now = OffsetDateTime::now_utc(); let send = scratch .store - .claim_send(&rule.id, &transition.id, &task, "gone@izlek.sh", now, now) + .claim_send(&rule.id, &transition.id, &task, "gone@iz.sh", now, now) .await .unwrap() .unwrap(); @@ -4396,7 +4396,7 @@ async fn an_accepted_send_stops_being_owed() { let now = OffsetDateTime::now_utc(); let send = scratch .store - .claim_send(&rule.id, &transition.id, &task, "ada@izlek.sh", now, now) + .claim_send(&rule.id, &transition.id, &task, "ada@iz.sh", now, now) .await .unwrap() .unwrap(); @@ -4427,14 +4427,14 @@ async fn a_viewer_is_never_a_recipient() { .store .create_user(NewUser { workspace_id: workspace.clone(), - email: "viewer@izlek.sh".into(), + email: "viewer@iz.sh".into(), display_name: "Vera".into(), role: Role::Viewer, invited_by: None, }) .await .unwrap(); - let mate = member(&scratch.store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&scratch.store, &workspace, "emre@iz.sh", "Emre").await; let task = add_task( &scratch.store, &workspace, @@ -4455,7 +4455,7 @@ async fn a_viewer_is_never_a_recipient() { scratch.store.recipients_for_board(&board.id).await.unwrap(), ] { assert!( - list.iter().all(|person| person.email != "viewer@izlek.sh"), + list.iter().all(|person| person.email != "viewer@iz.sh"), "a Viewer was about to be mailed: {list:?}" ); } @@ -4465,7 +4465,7 @@ async fn a_viewer_is_never_a_recipient() { .iter() .map(|p| p.email.as_str()) .collect::>(), - ["emre@izlek.sh"] + ["emre@iz.sh"] ); } @@ -4486,7 +4486,7 @@ async fn deleting_a_rule_takes_its_ledger_with_it() { let now = OffsetDateTime::now_utc(); scratch .store - .claim_send(&rule.id, &transition.id, &task, "ada@izlek.sh", now, now) + .claim_send(&rule.id, &transition.id, &task, "ada@iz.sh", now, now) .await .unwrap(); @@ -4507,7 +4507,7 @@ async fn deleting_a_rule_takes_its_ledger_with_it() { // -- the engine ------------------------------------------------------------ -use izlek_core::mail::{Engine, MailError, Mailer, Outgoing, Report, backoff}; +use iz_core::mail::{Engine, MailError, Mailer, Outgoing, Report, backoff}; use std::sync::Mutex; /// A mail server that remembers instead of sending, and refuses when told to. @@ -4558,10 +4558,10 @@ async fn shared() -> (PathBuf, Arc, String, String) { /// The same, with a quiet window of `minutes` on the workspace. async fn waiting(minutes: u32) -> (PathBuf, Arc, String, String) { - let dir = std::env::temp_dir().join(format!("izlek-test-{}", Ulid::new())); + let dir = std::env::temp_dir().join(format!("iz-test-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); let store = Arc::new( - TursoStore::open(dir.join("izlek.db").to_str().unwrap(), &dir.join("storage")) + TursoStore::open(dir.join("iz.db").to_str().unwrap(), &dir.join("storage")) .await .unwrap(), ); @@ -4584,7 +4584,7 @@ async fn waiting(minutes: u32) -> (PathBuf, Arc, String, String) { #[tokio::test] async fn a_crossing_mails_the_people_on_the_card_once() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@iz.sh", "Emre").await; let task = add_task( &store, &workspace, @@ -4598,7 +4598,7 @@ async fn a_crossing_mails_the_people_on_the_card_once() { let rule = a_rule(&store, &workspace, "Done", "Task completed").await; let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); let transition = moved_to(&store, &workspace, &task, "Backlog", "Done", &admin).await; let first = engine.on_transition(&transition).await.unwrap(); @@ -4611,11 +4611,11 @@ async fn a_crossing_mails_the_people_on_the_card_once() { let sent = mailer.sent(); assert_eq!(sent.len(), 1); - assert_eq!(sent[0].to, "emre@izlek.sh"); + assert_eq!(sent[0].to, "emre@iz.sh"); assert_eq!(sent[0].subject, "Task completed"); assert!(sent[0].body.contains("CLI install script")); assert!( - sent[0].body.contains("https://izlek.sh/?task="), + sent[0].body.contains("https://iz.sh/?task="), "the mail links back to the task: {}", sent[0].body ); @@ -4626,7 +4626,7 @@ async fn a_crossing_mails_the_people_on_the_card_once() { #[tokio::test] async fn a_task_created_straight_into_a_watched_column_mails_too() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@iz.sh", "Emre").await; let rule = a_rule(&store, &workspace, "In Progress", "Work started").await; let board = store.board(&workspace).await.unwrap().unwrap(); @@ -4650,13 +4650,13 @@ async fn a_task_created_straight_into_a_watched_column_mails_too() { assert_eq!(created.transition.to_column, column_id); let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); let report = engine.on_transition(&created.transition).await.unwrap(); assert_eq!(report.sent, 1); let sent = mailer.sent(); assert_eq!(sent.len(), 1); - assert_eq!(sent[0].to, "emre@izlek.sh"); + assert_eq!(sent[0].to, "emre@iz.sh"); assert_eq!(sent[0].subject, "Work started"); assert_eq!(store.sends_for_rule(&rule.id, 10).await.unwrap().len(), 1); let _ = std::fs::remove_dir_all(&dir); @@ -4665,12 +4665,12 @@ async fn a_task_created_straight_into_a_watched_column_mails_too() { #[tokio::test] async fn an_edited_rule_does_not_remail_a_crossing_it_already_covered() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@iz.sh", "Emre").await; let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; store.assign_task(&task, &mate).await.unwrap(); let rule = a_rule(&store, &workspace, "Done", "Task completed").await; let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); let transition = moved_to(&store, &workspace, &task, "Backlog", "Done", &admin).await; engine.on_transition(&transition).await.unwrap(); @@ -4688,14 +4688,14 @@ async fn an_edited_rule_does_not_remail_a_crossing_it_already_covered() { #[tokio::test] async fn a_rule_that_is_off_sends_nothing() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@iz.sh", "Emre").await; let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; store.assign_task(&task, &mate).await.unwrap(); let rule = a_rule(&store, &workspace, "Done", "Task completed").await; store.set_mail_rule_enabled(&rule.id, false).await.unwrap(); let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); let transition = moved_to(&store, &workspace, &task, "Backlog", "Done", &admin).await; assert_eq!( engine.on_transition(&transition).await.unwrap(), @@ -4711,7 +4711,7 @@ async fn a_rule_that_is_off_sends_nothing() { #[tokio::test] async fn a_rule_can_opt_the_task_key_into_its_own_mail() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@iz.sh", "Emre").await; let board = store.board(&workspace).await.unwrap().unwrap(); let with_details = add_task( &store, @@ -4740,7 +4740,7 @@ async fn a_rule_can_opt_the_task_key_into_its_own_mail() { let opted_out = a_rule(&store, &workspace, "Done", "Task completed, plain").await; let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); let moved = moved_to(&store, &workspace, &with_details, "Backlog", "Done", &admin).await; engine.on_transition(&moved).await.unwrap(); @@ -4776,7 +4776,7 @@ async fn a_rule_can_opt_the_task_key_into_its_own_mail() { #[tokio::test] async fn a_mail_says_when_the_card_moved_not_when_it_was_sent() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@iz.sh", "Emre").await; let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; store.assign_task(&task, &mate).await.unwrap(); a_rule(&store, &workspace, "Done", "Task completed").await; @@ -4784,7 +4784,7 @@ async fn a_mail_says_when_the_card_moved_not_when_it_was_sent() { // The server is down when the card moves and comes back later. The mail // that finally goes out has to say Tuesday, not Thursday. let mailer = Remembering::refusing(vec![MailError::retryable("connection refused")]); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); let transition = moved_to(&store, &workspace, &task, "Backlog", "Done", &admin).await; let refused = engine.on_transition(&transition).await.unwrap(); assert_eq!(refused.failed, 1); @@ -4805,28 +4805,28 @@ async fn a_mail_says_when_the_card_moved_not_when_it_was_sent() { #[tokio::test] async fn a_failing_send_is_retried_a_bounded_number_of_times_and_then_written_off() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@iz.sh", "Emre").await; let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; store.assign_task(&task, &mate).await.unwrap(); let rule = a_rule(&store, &workspace, "Done", "Task completed").await; let mailer = Remembering::refusing( - (0..izlek_core::mail::MAX_ATTEMPTS) + (0..iz_core::mail::MAX_ATTEMPTS) .map(|_| MailError::retryable("connection timed out")) .collect(), ); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); let transition = moved_to(&store, &workspace, &task, "Backlog", "Done", &admin).await; engine.on_transition(&transition).await.unwrap(); let mut when = OffsetDateTime::now_utc(); - for _ in 1..izlek_core::mail::MAX_ATTEMPTS { - when += backoff(izlek_core::mail::MAX_ATTEMPTS) + Duration::minutes(1); + for _ in 1..iz_core::mail::MAX_ATTEMPTS { + when += backoff(iz_core::mail::MAX_ATTEMPTS) + Duration::minutes(1); engine.deliver_owed(when, 10).await.unwrap(); } let ledger = &store.sends_for_rule(&rule.id, 10).await.unwrap()[0]; - assert_eq!(ledger.attempts, izlek_core::mail::MAX_ATTEMPTS); + assert_eq!(ledger.attempts, iz_core::mail::MAX_ATTEMPTS); assert_eq!(ledger.state, SendState::Abandoned); assert_eq!(ledger.last_error.as_deref(), Some("connection timed out")); assert!( @@ -4844,13 +4844,13 @@ async fn a_failing_send_is_retried_a_bounded_number_of_times_and_then_written_of #[tokio::test] async fn a_refused_address_is_written_off_at_the_first_answer() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@iz.sh", "Emre").await; let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; store.assign_task(&task, &mate).await.unwrap(); let rule = a_rule(&store, &workspace, "Done", "Task completed").await; let mailer = Remembering::refusing(vec![MailError::permanent("550 no such mailbox")]); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); let transition = moved_to(&store, &workspace, &task, "Backlog", "Done", &admin).await; let report = engine.on_transition(&transition).await.unwrap(); assert_eq!(report.abandoned, 1); @@ -4865,7 +4865,7 @@ async fn a_refused_address_is_written_off_at_the_first_answer() { #[tokio::test] async fn you_can_start_now_waits_for_the_last_blocker() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@iz.sh", "Emre").await; let board = store.board(&workspace).await.unwrap().unwrap(); let waiting = add_task( &store, @@ -4903,7 +4903,7 @@ async fn you_can_start_now_waits_for_the_last_blocker() { .unwrap(); let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); // One blocker finished is not unblocked: the other one is still in the way, // and telling Emre to start would be a lie. @@ -4915,7 +4915,7 @@ async fn you_can_start_now_waits_for_the_last_blocker() { assert_eq!(engine.on_transition(&two).await.unwrap().sent, 1); let sent = mailer.sent(); assert_eq!(sent.len(), 1); - assert_eq!(sent[0].to, "emre@izlek.sh"); + assert_eq!(sent[0].to, "emre@iz.sh"); assert!( sent[0].body.contains("Onboarding mails"), "the mail is about the freed task, not the blocker: {}", @@ -4927,7 +4927,7 @@ async fn you_can_start_now_waits_for_the_last_blocker() { #[tokio::test] async fn a_card_that_did_not_move_owes_nobody_a_mail() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@iz.sh", "Emre").await; let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; store.assign_task(&task, &mate).await.unwrap(); a_rule(&store, &workspace, "Done", "Task completed").await; @@ -4947,7 +4947,7 @@ async fn a_card_that_did_not_move_owes_nobody_a_mail() { #[tokio::test] async fn a_deleted_blocker_also_says_you_can_start_now() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@iz.sh", "Emre").await; let board = store.board(&workspace).await.unwrap().unwrap(); let waiting = add_task( &store, @@ -4975,7 +4975,7 @@ async fn a_deleted_blocker_also_says_you_can_start_now() { .unwrap(); let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); // A blocker can leave the way in two ways, and being deleted is one of // them. The person waiting hears about it either way. @@ -4993,7 +4993,7 @@ async fn a_deleted_blocker_also_says_you_can_start_now() { let sent = mailer.sent(); assert_eq!(sent.len(), 1); - assert_eq!(sent[0].to, "emre@izlek.sh"); + assert_eq!(sent[0].to, "emre@iz.sh"); assert_eq!(sent[0].subject, "You can start now"); assert!( sent[0].body.contains("Onboarding mails"), @@ -5011,7 +5011,7 @@ async fn a_deleted_blocker_also_says_you_can_start_now() { #[tokio::test] async fn a_delete_that_leaves_somebody_still_waiting_mails_nobody() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@iz.sh", "Emre").await; let board = store.board(&workspace).await.unwrap().unwrap(); let waiting = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; let first = add_task(&store, &workspace, "Backlog", "Signing keys", None, &admin).await; @@ -5041,7 +5041,7 @@ async fn a_delete_that_leaves_somebody_still_waiting_mails_nobody() { .unwrap(); let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); // Deleting one of two blockers frees nobody, so there is no event at all // and nothing to fire on. @@ -5068,7 +5068,7 @@ async fn a_delete_that_leaves_somebody_still_waiting_mails_nobody() { #[tokio::test] async fn a_mail_owed_by_a_delete_is_rebuilt_from_the_delete_on_a_retry() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@iz.sh", "Emre").await; let board = store.board(&workspace).await.unwrap().unwrap(); let waiting = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; let blocker = add_task(&store, &workspace, "Backlog", "Signing keys", None, &admin).await; @@ -5092,7 +5092,7 @@ async fn a_mail_owed_by_a_delete_is_rebuilt_from_the_delete_on_a_retry() { // readable back as an event — the deleted task's key included, since the // task itself is gone. let mailer = Remembering::refusing(vec![MailError::retryable("connection refused")]); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); let deletion = store.delete_task(&blocker, &admin, now).await.unwrap(); let freeing = deletion.event.clone().unwrap(); assert_eq!( @@ -5122,16 +5122,16 @@ async fn a_mail_owed_by_a_delete_is_rebuilt_from_the_delete_on_a_retry() { #[tokio::test] async fn nobody_is_mailed_about_what_they_did_themselves() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@iz.sh", "Emre").await; let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; store.assign_task(&task, &mate).await.unwrap(); let rule = a_rule(&store, &workspace, "Done", "Task completed").await; let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); // Emre is the only assignee and Emre moved the card. Telling him what he - // just did is how a person learns to filter İzlek's mail away. + // just did is how a person learns to filter İz's mail away. let transition = moved_to(&store, &workspace, &task, "Backlog", "Done", &mate).await; let report = engine.on_transition(&transition).await.unwrap(); assert_eq!(report, Default::default()); @@ -5145,18 +5145,18 @@ async fn nobody_is_mailed_about_what_they_did_themselves() { #[tokio::test] async fn a_rule_that_owed_nobody_still_says_so() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@iz.sh", "Emre").await; let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; store.assign_task(&task, &mate).await.unwrap(); let rule = a_rule(&store, &workspace, "Done", "Task completed").await; let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); let transition = moved_to(&store, &workspace, &task, "Backlog", "Done", &mate).await; engine.on_transition(&transition).await.unwrap(); let decisions = store - .recent_mail_decisions(10, izlek_core::store::FeedPage::Newest) + .recent_mail_decisions(10, iz_core::store::FeedPage::Newest) .await .unwrap(); let row = decisions @@ -5174,14 +5174,14 @@ async fn a_rule_that_did_not_match_leaves_a_reason() { let rule = a_rule(&store, &workspace, "Done", "Task completed").await; let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); // Rule watches "Done"; this crossing lands in "Review", so the rule never // fires for it. let transition = moved_to(&store, &workspace, &task, "Backlog", "Review", &admin).await; engine.on_transition(&transition).await.unwrap(); let decisions = store - .recent_mail_decisions(10, izlek_core::store::FeedPage::Newest) + .recent_mail_decisions(10, iz_core::store::FeedPage::Newest) .await .unwrap(); let row = decisions @@ -5200,7 +5200,7 @@ async fn a_deleted_task_still_leaves_a_task_gone_row() { let rule = a_rule(&store, &workspace, "Done", "Task completed").await; let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); // The crossing happened; the task is gone before the engine gets to it — // a retry, or a worker that lagged behind a delete. let transition = moved_to(&store, &workspace, &task, "Backlog", "Done", &admin).await; @@ -5214,7 +5214,7 @@ async fn a_deleted_task_still_leaves_a_task_gone_row() { assert!(mailer.sent().is_empty()); let decisions = store - .recent_mail_decisions(10, izlek_core::store::FeedPage::Newest) + .recent_mail_decisions(10, iz_core::store::FeedPage::Newest) .await .unwrap(); let row = decisions @@ -5230,7 +5230,7 @@ async fn a_deleted_task_still_leaves_a_task_gone_row() { #[tokio::test] async fn the_actor_comes_off_the_board_audience_too_and_the_rest_still_get_it() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@iz.sh", "Emre").await; let board = store.board(&workspace).await.unwrap().unwrap(); let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; let column_id = column_named(&store, &workspace, "Done").await; @@ -5247,13 +5247,13 @@ async fn the_actor_comes_off_the_board_audience_too_and_the_rest_still_get_it() .unwrap(); let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); let transition = moved_to(&store, &workspace, &task, "Backlog", "Done", &mate).await; assert_eq!(engine.on_transition(&transition).await.unwrap().sent, 1); let sent = mailer.sent(); assert_eq!(sent.len(), 1, "the board minus the person who moved it"); - assert_eq!(sent[0].to, "ada@izlek.sh"); + assert_eq!(sent[0].to, "ada@iz.sh"); let _ = std::fs::remove_dir_all(&dir); } @@ -5342,7 +5342,7 @@ async fn updating_a_rule_leaves_its_identity_and_ledger_alone() { let decisions = scratch .store - .recent_mail_decisions(10, izlek_core::store::FeedPage::Newest) + .recent_mail_decisions(10, iz_core::store::FeedPage::Newest) .await .unwrap(); assert!( @@ -5372,7 +5372,7 @@ async fn a_rules_creator_audience_names_who_opened_the_card() { .store .create_user(NewUser { workspace_id: workspace.clone(), - email: "viewer@izlek.sh".into(), + email: "viewer@iz.sh".into(), display_name: "Vera".into(), role: Role::Viewer, invited_by: None, @@ -5434,7 +5434,7 @@ async fn an_account_records_the_admin_who_made_it() { .store .create_user(NewUser { workspace_id: ws_id, - email: "grace@izlek.sh".into(), + email: "grace@iz.sh".into(), display_name: "Grace".into(), role: Role::Member, invited_by: Some(admin_id.clone()), @@ -5534,7 +5534,7 @@ async fn a_file_name_that_is_a_path_is_stored_as_the_label_it_is() { let written: Vec = std::fs::read_dir(&scratch.dir) .unwrap() .map(|entry| entry.unwrap().file_name().to_string_lossy().into_owned()) - .filter(|name| !name.starts_with("izlek.db") && name != "izlek.key" && name != "storage") + .filter(|name| !name.starts_with("iz.db") && name != "iz.key" && name != "storage") .collect(); assert!(written.is_empty(), "{written:?}"); } @@ -5605,7 +5605,7 @@ async fn a_file_can_be_taken_away_and_saying_so_twice_is_answered_honestly() { /// come back in. #[tokio::test] async fn keyset_paging_covers_the_queue_ascending() { - use izlek_core::store::{FeedCursor, FeedPage}; + use iz_core::store::{FeedCursor, FeedPage}; let (scratch, _workspace, _admin) = workspace_with_admin().await; let store = &scratch.store; @@ -5613,7 +5613,7 @@ async fn keyset_paging_covers_the_queue_ascending() { for i in 0..11 { store .queue_invite( - &format!("row{i}@izlek.sh"), + &format!("row{i}@iz.sh"), "Join", "Come aboard.", t0 + Duration::seconds(i), @@ -5658,7 +5658,7 @@ async fn the_queue_shows_what_is_owed_and_not_what_is_done() { &rule.id, &transition.id, &task, - "pending@izlek.sh", + "pending@iz.sh", now, now, ) @@ -5667,7 +5667,7 @@ async fn the_queue_shows_what_is_owed_and_not_what_is_done() { .unwrap(); let failed = store - .claim_send(&rule.id, &transition.id, &task, "failed@izlek.sh", now, now) + .claim_send(&rule.id, &transition.id, &task, "failed@iz.sh", now, now) .await .unwrap() .unwrap(); @@ -5677,7 +5677,7 @@ async fn the_queue_shows_what_is_owed_and_not_what_is_done() { .unwrap(); let sent = store - .claim_send(&rule.id, &transition.id, &task, "sent@izlek.sh", now, now) + .claim_send(&rule.id, &transition.id, &task, "sent@iz.sh", now, now) .await .unwrap() .unwrap(); @@ -5688,7 +5688,7 @@ async fn the_queue_shows_what_is_owed_and_not_what_is_done() { &rule.id, &transition.id, &task, - "abandoned@izlek.sh", + "abandoned@iz.sh", now, now, ) @@ -5701,7 +5701,7 @@ async fn the_queue_shows_what_is_owed_and_not_what_is_done() { .unwrap(); let queue = store - .mail_queue(10, izlek_core::store::FeedPage::Newest) + .mail_queue(10, iz_core::store::FeedPage::Newest) .await .unwrap(); let ids: Vec<&str> = queue.iter().map(|s| s.id.as_str()).collect(); @@ -5718,7 +5718,7 @@ async fn an_invite_mail_is_owed_without_a_rule() { let now = OffsetDateTime::now_utc(); let invite = store - .queue_invite("newcomer@izlek.sh", "Join İzlek", "Come aboard.", now) + .queue_invite("newcomer@iz.sh", "Join İz", "Come aboard.", now) .await .unwrap(); assert_eq!(invite.rule_id, None); @@ -5729,7 +5729,7 @@ async fn an_invite_mail_is_owed_without_a_rule() { assert_eq!(found.rule_id, None); let queue = store - .mail_queue(10, izlek_core::store::FeedPage::Newest) + .mail_queue(10, iz_core::store::FeedPage::Newest) .await .unwrap(); let found = queue.iter().find(|s| s.id == invite.id).unwrap(); @@ -5741,23 +5741,23 @@ async fn an_invite_mail_with_no_sender_is_held_not_failed() { let (dir, store, _workspace, _admin) = shared().await; let now = OffsetDateTime::now_utc(); store - .queue_invite("newcomer@izlek.sh", "Join İzlek", "Come aboard.", now) + .queue_invite("newcomer@iz.sh", "Join İz", "Come aboard.", now) .await .unwrap(); let mailer = Remembering::refusing(vec![MailError::unsent("no sender configured")]); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); let report = engine.deliver_owed(now, 10).await.unwrap(); assert_eq!(report.held, 1); assert_eq!(report.sent, 0); let queue = store - .mail_queue(10, izlek_core::store::FeedPage::Newest) + .mail_queue(10, iz_core::store::FeedPage::Newest) .await .unwrap(); let held = queue .iter() - .find(|s| s.recipient == "newcomer@izlek.sh") + .find(|s| s.recipient == "newcomer@iz.sh") .unwrap(); assert_eq!(held.attempts, 0); let _ = std::fs::remove_dir_all(&dir); @@ -5788,7 +5788,7 @@ async fn two_passes_over_one_owed_mail_send_it_once() { let (dir, store, _workspace, _admin) = shared().await; let now = OffsetDateTime::now_utc(); store - .queue_invite("newcomer@izlek.sh", "Join İzlek", "Come aboard.", now) + .queue_invite("newcomer@iz.sh", "Join İz", "Come aboard.", now) .await .unwrap(); @@ -5797,8 +5797,8 @@ async fn two_passes_over_one_owed_mail_send_it_once() { }); // Two engines over one store, which is what the process actually has: the // request's pass and the sweep's. - let request = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); - let sweep = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let request = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); + let sweep = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); let (a, b) = tokio::join!(request.deliver_owed(now, 10), sweep.deliver_owed(now, 10),); let (a, b) = (a.unwrap(), b.unwrap()); @@ -5817,7 +5817,7 @@ async fn two_passes_over_one_owed_mail_send_it_once() { // the lease runs out — the loser leaving it alone is not the same as the // mail being dropped. let owed = store - .sends_owed(now + izlek_core::mail::LEASE + Duration::seconds(1), 10) + .sends_owed(now + iz_core::mail::LEASE + Duration::seconds(1), 10) .await .unwrap(); assert!( @@ -5834,7 +5834,7 @@ async fn a_crossing_and_a_sweep_at_the_same_moment_mail_once() { // which wakes the sweep, while the pass that wrote it is still composing. // The row is therefore born held, and this is the test that says so. let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@iz.sh", "Emre").await; let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; store.assign_task(&task, &mate).await.unwrap(); let _rule = a_rule(&store, &workspace, "Done", "Task completed").await; @@ -5843,8 +5843,8 @@ async fn a_crossing_and_a_sweep_at_the_same_moment_mail_once() { let mailer = Arc::new(Dawdling { sent: Mutex::new(Vec::new()), }); - let crossing = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); - let sweep = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let crossing = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); + let sweep = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); // The sweep passes run while the crossing is inside its send, which is // exactly when the row it just wrote is sitting in the ledger. @@ -5875,12 +5875,12 @@ async fn a_lease_that_expires_gives_the_mail_back() { let store = &scratch.store; let now = OffsetDateTime::now_utc(); let invite = store - .queue_invite("newcomer@izlek.sh", "Join İzlek", "Come aboard.", now) + .queue_invite("newcomer@iz.sh", "Join İz", "Come aboard.", now) .await .unwrap(); let mine = store - .claim_sends_owed(now, now + izlek_core::mail::LEASE, 10) + .claim_sends_owed(now, now + iz_core::mail::LEASE, 10) .await .unwrap(); assert!( @@ -5888,7 +5888,7 @@ async fn a_lease_that_expires_gives_the_mail_back() { "the first pass did not get a mail nobody holds" ); let theirs = store - .claim_sends_owed(now, now + izlek_core::mail::LEASE, 10) + .claim_sends_owed(now, now + iz_core::mail::LEASE, 10) .await .unwrap(); assert!( @@ -5898,7 +5898,7 @@ async fn a_lease_that_expires_gives_the_mail_back() { // Nobody wrote the outcome down, so once the lease is out the mail is owed // again rather than lost. let owed = store - .sends_owed(now + izlek_core::mail::LEASE + Duration::seconds(1), 10) + .sends_owed(now + iz_core::mail::LEASE + Duration::seconds(1), 10) .await .unwrap(); assert!( @@ -5911,7 +5911,7 @@ async fn a_lease_that_expires_gives_the_mail_back() { async fn the_activity_feed_is_the_whole_workspace_newest_first() { let (scratch, workspace, admin) = workspace_with_admin().await; let store = &scratch.store; - let other = member(store, &workspace, "sam@izlek.sh", "Sam").await; + let other = member(store, &workspace, "sam@iz.sh", "Sam").await; let task_a = add_task(store, &workspace, "Backlog", "first task", None, &admin).await; let task_b = add_task(store, &workspace, "Backlog", "second task", None, &admin).await; let t0 = OffsetDateTime::now_utc(); @@ -5935,9 +5935,9 @@ async fn the_activity_feed_is_the_whole_workspace_newest_first() { let feed = store .recent_activity( 10, - izlek_core::store::FeedPage::Newest, - izlek_core::store::Dir::Newest, - &izlek_core::store::ActivityFilter::default(), + iz_core::store::FeedPage::Newest, + iz_core::store::Dir::Newest, + &iz_core::store::ActivityFilter::default(), ) .await .unwrap(); @@ -5958,7 +5958,7 @@ async fn the_activity_feed_is_the_whole_workspace_newest_first() { /// feed reads. #[tokio::test] async fn keyset_paging_covers_every_activity_row_once() { - use izlek_core::store::{FeedCursor, FeedPage}; + use iz_core::store::{FeedCursor, FeedPage}; let (scratch, workspace, admin) = workspace_with_admin().await; let store = &scratch.store; @@ -5980,8 +5980,8 @@ async fn keyset_paging_covers_every_activity_row_once() { .recent_activity( 100, FeedPage::Newest, - izlek_core::store::Dir::Newest, - &izlek_core::store::ActivityFilter::default(), + iz_core::store::Dir::Newest, + &iz_core::store::ActivityFilter::default(), ) .await .unwrap(); @@ -5994,8 +5994,8 @@ async fn keyset_paging_covers_every_activity_row_once() { .recent_activity( 7, page, - izlek_core::store::Dir::Newest, - &izlek_core::store::ActivityFilter::default(), + iz_core::store::Dir::Newest, + &iz_core::store::ActivityFilter::default(), ) .await .unwrap(); @@ -6038,9 +6038,9 @@ async fn an_account_event_rides_the_feed_without_a_task() { let feed = store .recent_activity( 10, - izlek_core::store::FeedPage::Newest, - izlek_core::store::Dir::Newest, - &izlek_core::store::ActivityFilter::default(), + iz_core::store::FeedPage::Newest, + iz_core::store::Dir::Newest, + &iz_core::store::ActivityFilter::default(), ) .await .unwrap(); @@ -6121,7 +6121,7 @@ async fn a_created_task_s_activity_id_resolves_as_an_event() { // -- the engine hears activity ---------------------------------------------- /// Reads an activity row back as the event the engine takes. -async fn activity_event(store: &TursoStore, activity_id: &str) -> izlek_core::store::ActivityEvent { +async fn activity_event(store: &TursoStore, activity_id: &str) -> iz_core::store::ActivityEvent { match store.event(activity_id).await.unwrap() { Some(Event::Happened(event)) => event, other => panic!("expected Event::Happened, got {other:?}"), @@ -6131,7 +6131,7 @@ async fn activity_event(store: &TursoStore, activity_id: &str) -> izlek_core::st #[tokio::test] async fn an_assignment_mails_the_assignees_minus_the_actor() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@iz.sh", "Emre").await; let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; store.assign_task(&task, &mate).await.unwrap(); let board = store.board(&workspace).await.unwrap().unwrap(); @@ -6148,7 +6148,7 @@ async fn an_assignment_mails_the_assignees_minus_the_actor() { .unwrap(); let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); // Ada assigned Emre; Ada is not on the assignee list to begin with, so // the audience is Emre alone. let activity_id = store @@ -6168,7 +6168,7 @@ async fn an_assignment_mails_the_assignees_minus_the_actor() { assert_eq!(first.sent, 1); let sent = mailer.sent(); assert_eq!(sent.len(), 1); - assert_eq!(sent[0].to, "emre@izlek.sh"); + assert_eq!(sent[0].to, "emre@iz.sh"); // The same activity replayed — a restart, a second worker — owns nothing // and sends nothing more. The unique index decided, not a read. @@ -6182,9 +6182,9 @@ async fn an_assignment_mails_the_assignees_minus_the_actor() { #[tokio::test] async fn assigning_one_person_mails_that_person_not_every_assignee() { let (dir, store, workspace, admin) = shared().await; - let first = member(&store, &workspace, "grace@izlek.sh", "Grace").await; - let second = member(&store, &workspace, "emre@izlek.sh", "Emre").await; - let third = member(&store, &workspace, "linus@izlek.sh", "Linus").await; + let first = member(&store, &workspace, "grace@iz.sh", "Grace").await; + let second = member(&store, &workspace, "emre@iz.sh", "Emre").await; + let third = member(&store, &workspace, "linus@iz.sh", "Linus").await; let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; store.assign_task(&task, &first).await.unwrap(); store.assign_task(&task, &second).await.unwrap(); @@ -6203,10 +6203,10 @@ async fn assigning_one_person_mails_that_person_not_every_assignee() { .unwrap(); let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); // Ada assigns Yusuf to a card that already carries three people: the line // is about Yusuf, so Yusuf is the audience — not the three already there. - let fourth = member(&store, &workspace, "yusuf@izlek.sh", "Yusuf").await; + let fourth = member(&store, &workspace, "yusuf@iz.sh", "Yusuf").await; let activity_id = store .record_activity( &task, @@ -6224,14 +6224,14 @@ async fn assigning_one_person_mails_that_person_not_every_assignee() { assert_eq!(report.sent, 1, "one assignment, one mail"); let sent = mailer.sent(); assert_eq!(sent.len(), 1); - assert_eq!(sent[0].to, "yusuf@izlek.sh"); + assert_eq!(sent[0].to, "yusuf@iz.sh"); let _ = std::fs::remove_dir_all(&dir); } #[tokio::test] async fn a_time_change_fires_a_deadline_set_rule() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@iz.sh", "Emre").await; let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; let board = store.board(&workspace).await.unwrap().unwrap(); store @@ -6247,7 +6247,7 @@ async fn a_time_change_fires_a_deadline_set_rule() { .unwrap(); let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); // Ada sets the time on her own card — a ClockSet activity, no deadline // in sight — and the only person the board audience can mail is Emre, // the board minus the actor. @@ -6268,7 +6268,7 @@ async fn a_time_change_fires_a_deadline_set_rule() { assert_eq!(report.sent, 1, "the time change mails the board"); let sent = mailer.sent(); assert_eq!(sent.len(), 1); - assert_eq!(sent[0].to, "emre@izlek.sh"); + assert_eq!(sent[0].to, "emre@iz.sh"); assert!( sent[0].body.contains("set the time to"), "the body says the honest per-kind sentence: {}", @@ -6280,8 +6280,8 @@ async fn a_time_change_fires_a_deadline_set_rule() { #[tokio::test] async fn an_unassignment_mails_the_person_removed_not_the_rest() { let (dir, store, workspace, admin) = shared().await; - let staying = member(&store, &workspace, "grace@izlek.sh", "Grace").await; - let leaving = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let staying = member(&store, &workspace, "grace@iz.sh", "Grace").await; + let leaving = member(&store, &workspace, "emre@iz.sh", "Emre").await; let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; store.assign_task(&task, &staying).await.unwrap(); store.assign_task(&task, &leaving).await.unwrap(); @@ -6299,7 +6299,7 @@ async fn an_unassignment_mails_the_person_removed_not_the_rest() { .unwrap(); let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); store.unassign_task(&task, &leaving).await.unwrap(); let activity_id = store .record_activity( @@ -6319,7 +6319,7 @@ async fn an_unassignment_mails_the_person_removed_not_the_rest() { let sent = mailer.sent(); assert_eq!(sent.len(), 1); assert_eq!( - sent[0].to, "emre@izlek.sh", + sent[0].to, "emre@iz.sh", "the mail is for the one removed" ); let _ = std::fs::remove_dir_all(&dir); @@ -6328,8 +6328,8 @@ async fn an_unassignment_mails_the_person_removed_not_the_rest() { #[tokio::test] async fn a_rule_whose_line_has_no_subject_still_mails_every_assignee() { let (dir, store, workspace, admin) = shared().await; - let first = member(&store, &workspace, "grace@izlek.sh", "Grace").await; - let second = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let first = member(&store, &workspace, "grace@iz.sh", "Grace").await; + let second = member(&store, &workspace, "emre@iz.sh", "Emre").await; let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; store.assign_task(&task, &first).await.unwrap(); store.assign_task(&task, &second).await.unwrap(); @@ -6347,7 +6347,7 @@ async fn a_rule_whose_line_has_no_subject_still_mails_every_assignee() { .unwrap(); let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); // A comment has no subject: the audience stays the whole assignee list, // minus the actor, exactly as before the subject column existed. let activity_id = store @@ -6367,14 +6367,14 @@ async fn a_rule_whose_line_has_no_subject_still_mails_every_assignee() { assert_eq!(report.sent, 2, "both assignees, the old breadth"); let mut to: Vec<_> = mailer.sent().iter().map(|m| m.to.clone()).collect(); to.sort(); - assert_eq!(to, vec!["emre@izlek.sh", "grace@izlek.sh"]); + assert_eq!(to, vec!["emre@iz.sh", "grace@iz.sh"]); let _ = std::fs::remove_dir_all(&dir); } #[tokio::test] async fn a_creator_audience_rule_mails_the_creator_and_nobody_when_the_creator_commented() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@iz.sh", "Emre").await; let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; let board = store.board(&workspace).await.unwrap().unwrap(); store @@ -6390,7 +6390,7 @@ async fn a_creator_audience_rule_mails_the_creator_and_nobody_when_the_creator_c .unwrap(); let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); // Emre comments on Ada's task: Ada, the creator, gets mailed. let commented_by_mate = store @@ -6409,7 +6409,7 @@ async fn a_creator_audience_rule_mails_the_creator_and_nobody_when_the_creator_c assert_eq!(report.sent, 1); let sent = mailer.sent(); assert_eq!(sent.len(), 1); - assert_eq!(sent[0].to, "ada@izlek.sh"); + assert_eq!(sent[0].to, "ada@iz.sh"); // Ada comments on her own task: the audience is only the actor, so // nobody is mailed and the ledger says why rather than looking silent. @@ -6430,7 +6430,7 @@ async fn a_creator_audience_rule_mails_the_creator_and_nobody_when_the_creator_c assert_eq!(mailer.sent().len(), 1, "no second mail went out"); let decisions = store - .recent_mail_decisions(10, izlek_core::store::FeedPage::Newest) + .recent_mail_decisions(10, iz_core::store::FeedPage::Newest) .await .unwrap(); let row = decisions @@ -6449,7 +6449,7 @@ async fn a_created_activity_does_not_fire_a_status_rule() { let rule = a_rule(&store, &workspace, "Done", "Task completed").await; let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); let activity_id = store .record_activity( &task, @@ -6468,7 +6468,7 @@ async fn a_created_activity_does_not_fire_a_status_rule() { assert!(mailer.sent().is_empty()); let decisions = store - .recent_mail_decisions(10, izlek_core::store::FeedPage::Newest) + .recent_mail_decisions(10, iz_core::store::FeedPage::Newest) .await .unwrap(); let row = decisions @@ -6508,7 +6508,7 @@ async fn decisions_and_sends_for_task_read_only_that_tasks_own_rows() { .await .unwrap(); let send = store - .claim_send(&rule.id, &transition.id, &task, "ada@izlek.sh", now, now) + .claim_send(&rule.id, &transition.id, &task, "ada@iz.sh", now, now) .await .unwrap() .unwrap(); @@ -6517,7 +6517,7 @@ async fn decisions_and_sends_for_task_read_only_that_tasks_own_rows() { &rule.id, &other_transition.id, &other_task, - "emre@izlek.sh", + "emre@iz.sh", now, now, ) @@ -6544,7 +6544,7 @@ async fn requeuing_a_send_puts_it_back_in_play_but_leaves_a_sent_one_alone() { let now = OffsetDateTime::now_utc(); let failed = store - .claim_send(&rule.id, &transition.id, &task, "failed@izlek.sh", now, now) + .claim_send(&rule.id, &transition.id, &task, "failed@iz.sh", now, now) .await .unwrap() .unwrap(); @@ -6554,7 +6554,7 @@ async fn requeuing_a_send_puts_it_back_in_play_but_leaves_a_sent_one_alone() { .unwrap(); let sent = store - .claim_send(&rule.id, &transition.id, &task, "sent@izlek.sh", now, now) + .claim_send(&rule.id, &transition.id, &task, "sent@iz.sh", now, now) .await .unwrap() .unwrap(); @@ -6588,12 +6588,12 @@ async fn a_queued_notice_is_pending_and_due_and_on_the_queue() { let now = OffsetDateTime::now_utc(); let queued = scratch .store - .queue_notice("grace@izlek.sh", "Heads up", "Body text", now) + .queue_notice("grace@iz.sh", "Heads up", "Body text", now) .await .unwrap(); assert_eq!(queued.kind, SendKind::Notice); assert_eq!(queued.state, SendState::Pending); - assert_eq!(queued.recipient, "grace@izlek.sh"); + assert_eq!(queued.recipient, "grace@iz.sh"); assert_eq!(queued.subject.as_deref(), Some("Heads up")); assert_eq!(queued.body.as_deref(), Some("Body text")); @@ -6602,7 +6602,7 @@ async fn a_queued_notice_is_pending_and_due_and_on_the_queue() { let mail_queue = scratch .store - .mail_queue(10, izlek_core::store::FeedPage::Newest) + .mail_queue(10, iz_core::store::FeedPage::Newest) .await .unwrap(); assert!( @@ -6619,12 +6619,12 @@ async fn the_engine_delivers_a_notice_that_owes_no_rule() { let (dir, store, _workspace, _admin) = shared().await; let now = OffsetDateTime::now_utc(); store - .queue_notice("grace@izlek.sh", "Heads up", "Body text", now) + .queue_notice("grace@iz.sh", "Heads up", "Body text", now) .await .unwrap(); let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); let report = engine .deliver_owed(now + Duration::minutes(1), 10) .await @@ -6633,7 +6633,7 @@ async fn the_engine_delivers_a_notice_that_owes_no_rule() { assert_eq!(report.sent, 1, "{report:?}"); let sent = mailer.sent(); assert_eq!(sent.len(), 1, "{sent:?}"); - assert_eq!(sent[0].to, "grace@izlek.sh"); + assert_eq!(sent[0].to, "grace@iz.sh"); assert_eq!(sent[0].subject, "Heads up"); assert_eq!(sent[0].body, "Body text"); @@ -6688,7 +6688,7 @@ async fn a_tasks_activity_reads_newest_first() { #[tokio::test] async fn a_status_rule_with_no_column_fires_on_every_crossing() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@iz.sh", "Emre").await; let board = store.board(&workspace).await.unwrap().unwrap(); let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; store.assign_task(&task, &mate).await.unwrap(); @@ -6706,7 +6706,7 @@ async fn a_status_rule_with_no_column_fires_on_every_crossing() { .unwrap(); let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); let first = moved_to(&store, &workspace, &task, "Backlog", "In Progress", &admin).await; engine.on_transition(&first).await.unwrap(); @@ -6759,7 +6759,7 @@ async fn an_every_column_rule_survives_the_round_trip() { #[tokio::test] async fn a_stored_address_is_the_one_mail_links_point_at() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@iz.sh", "Emre").await; let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; store.assign_task(&task, &mate).await.unwrap(); a_rule(&store, &workspace, "Done", "Task completed").await; @@ -6803,7 +6803,7 @@ async fn a_stored_address_is_the_one_mail_links_point_at() { /// Drains whatever the store has announced so far into the set of topic names. /// `try_recv` rather than `recv` on purpose: the point is what has ALREADY been /// said by the time the write returned, not what might arrive later. -fn announced(rx: &mut tokio::sync::broadcast::Receiver) -> Vec { +fn announced(rx: &mut tokio::sync::broadcast::Receiver) -> Vec { let mut seen = Vec::new(); while let Ok(change) = rx.try_recv() { seen.push(change.topic.kind().to_string()); @@ -6839,10 +6839,10 @@ async fn every_kind_of_write_announces_its_surface() { .await .unwrap(); // Members. - member(store, &workspace, "bo@izlek.sh", "Bo").await; + member(store, &workspace, "bo@iz.sh", "Bo").await; // Queue. store - .queue_notice("bo@izlek.sh", "Subject", "Body", now) + .queue_notice("bo@iz.sh", "Subject", "Body", now) .await .unwrap(); // Rules. @@ -6859,14 +6859,14 @@ async fn every_kind_of_write_announces_its_surface() { .unwrap(); // Settings. store - .set_public_url(&workspace, Some("https://izlek.example")) + .set_public_url(&workspace, Some("https://iz.example")) .await .unwrap(); // Activity with no task of its own. store .record_event( Some(&admin), - &izlek_core::detail::ActivityKind::Other("settings".to_string()), + &iz_core::detail::ActivityKind::Other("settings".to_string()), "", now, ) @@ -6986,12 +6986,12 @@ async fn the_next_due_moment_is_the_earliest_one() { let now = OffsetDateTime::now_utc(); // Queued out of order on purpose: the answer is the earliest, not the first. store - .queue_notice("late@izlek.sh", "Later", "body", now + Duration::hours(2)) + .queue_notice("late@iz.sh", "Later", "body", now + Duration::hours(2)) .await .unwrap(); store .queue_notice( - "soon@izlek.sh", + "soon@iz.sh", "Sooner", "body", now + Duration::minutes(5), @@ -7019,10 +7019,10 @@ async fn a_sender_check_is_recorded_apart_from_a_test_and_cleared_on_edit() { let sender = |host: &str| NewSender { host: host.to_string(), port: 465, - username: "izlek".into(), + username: "iz".into(), password: Some("hunter2".into()), - from_name: "İzlek".into(), - from_address: "izlek@izlek.sh".into(), + from_name: "İz".into(), + from_address: "iz@iz.sh".into(), }; store .set_sender(&workspace, sender("smtp.one.test")) @@ -7034,7 +7034,7 @@ async fn a_sender_check_is_recorded_apart_from_a_test_and_cleared_on_edit() { store .record_sender_check( &workspace, - izlek_core::store::SenderCheck { + iz_core::store::SenderCheck { at: now, took_ms: 120, error: None, @@ -7045,7 +7045,7 @@ async fn a_sender_check_is_recorded_apart_from_a_test_and_cleared_on_edit() { store .record_sender_test( &workspace, - izlek_core::store::SenderTest { + iz_core::store::SenderTest { at: now, took_ms: 0, error: Some("550 not allowed".into()), @@ -7078,19 +7078,19 @@ async fn a_sender_check_is_recorded_apart_from_a_test_and_cleared_on_edit() { } // --------------------------------------------------------------------------- -// izlek reconcile — bringing a database of the OLD shape onto the declared +// iz reconcile — bringing a database of the OLD shape onto the declared // schema. These tests carry the user's rule (2026-08-31): a table alteration // owes both a proof that the alteration holds and a proof that reconcile // carries a live-shaped database across it. // --------------------------------------------------------------------------- -/// Builds a database at the PRE-COLLAPSE schema — the shape İzlek was actually +/// Builds a database at the PRE-COLLAPSE schema — the shape İz was actually /// deployed with, kept verbatim in `tests/fixtures/` — and fills it with the /// kinds of row a live workspace holds, blobs included. async fn live_shaped_database() -> (PathBuf, String) { - let dir = std::env::temp_dir().join(format!("izlek-reconcile-{}", Ulid::new())); + let dir = std::env::temp_dir().join(format!("iz-reconcile-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); - let path = dir.join("izlek.db").to_str().unwrap().to_string(); + let path = dir.join("iz.db").to_str().unwrap().to_string(); let db = turso::Builder::new_local(&path).build().await.unwrap(); let conn = db.connect().unwrap(); @@ -7182,7 +7182,7 @@ fn backups_beside(dir: &PathBuf) -> Vec { found } -/// Brings a `live_shaped_database` up to the shape İzlek deployed between the +/// Brings a `live_shaped_database` up to the shape İz deployed between the /// schema collapse and today: the `tag` table exists, tasks wear `tag_id`, /// and each board carries its default `General` plus a tag the admin made — /// with the four declared-schema objects a live database still lacks absent, @@ -7223,10 +7223,10 @@ async fn tagged_live_database() -> (PathBuf, String) { async fn reconcile_carries_a_live_shaped_database_onto_the_declared_schema() { let (dir, path) = live_shaped_database().await; - izlek_core::store::reconcile( + iz_core::store::reconcile( &path, Some(&dir.join("storage")), - izlek_core::store::ReconcileOptions { + iz_core::store::ReconcileOptions { dry_run: false, yes: true, auto: true, @@ -7239,8 +7239,8 @@ async fn reconcile_carries_a_live_shaped_database_onto_the_declared_schema() { let conn = db.connect().unwrap(); // The schema is now the declared one, exactly. - let after = izlek_core::store::schema::fingerprint(&conn).await.unwrap(); - let declared = izlek_core::store::schema::declared_fingerprint() + let after = iz_core::store::schema::fingerprint(&conn).await.unwrap(); + let declared = iz_core::store::schema::declared_fingerprint() .await .unwrap(); assert_eq!( @@ -7375,10 +7375,10 @@ async fn reconcile_carries_a_live_shaped_database_onto_the_declared_schema() { async fn reconcile_preserves_user_tags_and_the_tasks_that_wear_them() { let (dir, path) = tagged_live_database().await; - izlek_core::store::reconcile( + iz_core::store::reconcile( &path, Some(&dir.join("storage")), - izlek_core::store::ReconcileOptions { + iz_core::store::ReconcileOptions { dry_run: false, yes: true, auto: true, @@ -7461,10 +7461,10 @@ async fn reconcile_seeds_a_default_only_for_a_board_without_one() { .unwrap(); } - izlek_core::store::reconcile( + iz_core::store::reconcile( &path, Some(&dir.join("storage")), - izlek_core::store::ReconcileOptions { + iz_core::store::ReconcileOptions { dry_run: false, yes: true, auto: true, @@ -7528,12 +7528,12 @@ async fn reconcile_seeds_a_default_only_for_a_board_without_one() { #[tokio::test] async fn reconciling_a_database_that_already_matches_changes_nothing() { let scratch = Scratch::open().await; - let path = scratch.dir.join("izlek.db").to_str().unwrap().to_string(); + let path = scratch.dir.join("iz.db").to_str().unwrap().to_string(); - izlek_core::store::reconcile( + iz_core::store::reconcile( &path, Some(&scratch.dir.join("storage")), - izlek_core::store::ReconcileOptions { + iz_core::store::ReconcileOptions { dry_run: false, yes: true, auto: true, @@ -7562,8 +7562,8 @@ async fn opening_a_stale_database_repairs_it() { let db = turso::Builder::new_local(&path).build().await.unwrap(); let conn = db.connect().unwrap(); assert_eq!( - izlek_core::store::schema::fingerprint(&conn).await.unwrap(), - izlek_core::store::schema::declared_fingerprint() + iz_core::store::schema::fingerprint(&conn).await.unwrap(), + iz_core::store::schema::declared_fingerprint() .await .unwrap(), ); @@ -7585,13 +7585,13 @@ async fn opening_a_stale_database_repairs_it() { #[tokio::test] async fn two_repairs_leave_two_backups() { let (dir, path) = live_shaped_database().await; - let opts = || izlek_core::store::ReconcileOptions { + let opts = || iz_core::store::ReconcileOptions { dry_run: false, yes: true, auto: true, }; - izlek_core::store::reconcile(&path, Some(&dir.join("storage")), opts()).await.unwrap(); + iz_core::store::reconcile(&path, Some(&dir.join("storage")), opts()).await.unwrap(); assert_eq!(backups_beside(&dir).len(), 1); // Put the database back to the old shape and repair it again: the first @@ -7605,7 +7605,7 @@ async fn two_repairs_leave_two_backups() { drop(conn); drop(db); - izlek_core::store::reconcile(&path, Some(&dir.join("storage")), opts()).await.unwrap(); + iz_core::store::reconcile(&path, Some(&dir.join("storage")), opts()).await.unwrap(); let backups = backups_beside(&dir); assert_eq!( backups.len(), @@ -7621,7 +7621,7 @@ async fn two_repairs_leave_two_backups() { #[tokio::test] async fn a_rebuild_keeps_a_window_the_admin_already_set() { let scratch = Scratch::open().await; - let path = scratch.dir.join("izlek.db").to_str().unwrap().to_string(); + let path = scratch.dir.join("iz.db").to_str().unwrap().to_string(); let (workspace, _) = claim(&scratch.store).await; let limits = scratch.store.workspace().await.unwrap().unwrap(); scratch @@ -7647,10 +7647,10 @@ async fn a_rebuild_keeps_a_window_the_admin_already_set() { drop(conn); drop(db); - izlek_core::store::reconcile( + iz_core::store::reconcile( &path, Some(&scratch.dir.join("storage")), - izlek_core::store::ReconcileOptions { + iz_core::store::ReconcileOptions { dry_run: false, yes: true, auto: true, @@ -7682,7 +7682,7 @@ async fn user_stats_counts_what_a_person_holds_finished_opened_and_said() { let scratch = Scratch::open().await; let (workspace, admin) = claim(&scratch.store).await; let store = &scratch.store; - let mem = member(store, &workspace, "mem@izlek.sh", "Mem Ber").await; + let mem = member(store, &workspace, "mem@iz.sh", "Mem Ber").await; let backlog = column_named(store, &workspace, "Backlog").await; let done = column_named(store, &workspace, "Done").await; let now = OffsetDateTime::now_utc(); @@ -7718,7 +7718,7 @@ async fn user_stats_counts_what_a_person_holds_finished_opened_and_said() { assert_eq!( store.user_stats(&mem).await.unwrap(), - izlek_core::store::UserStats { + iz_core::store::UserStats { assigned_open: 2, assigned_done: 1, created: 3, @@ -7732,13 +7732,13 @@ async fn a_deleted_task_counts_nowhere_and_a_person_with_nothing_counts_nothing( let scratch = Scratch::open().await; let (workspace, admin) = claim(&scratch.store).await; let store = &scratch.store; - let mem = member(store, &workspace, "mem@izlek.sh", "Mem Ber").await; - let shy = member(store, &workspace, "shy@izlek.sh", "Shy Guy").await; + let mem = member(store, &workspace, "mem@iz.sh", "Mem Ber").await; + let shy = member(store, &workspace, "shy@iz.sh", "Shy Guy").await; let now = OffsetDateTime::now_utc(); assert_eq!( store.user_stats(­).await.unwrap(), - izlek_core::store::UserStats { + iz_core::store::UserStats { assigned_open: 0, assigned_done: 0, created: 0, @@ -7758,7 +7758,7 @@ async fn a_deleted_task_counts_nowhere_and_a_person_with_nothing_counts_nothing( store.delete_task(&doomed, &admin, now).await.unwrap(); assert_eq!( store.user_stats(&mem).await.unwrap(), - izlek_core::store::UserStats { + iz_core::store::UserStats { assigned_open: 0, assigned_done: 0, created: 0, @@ -7805,11 +7805,11 @@ async fn tell_the_engine(store: &TursoStore, engine: &Engine, ids: &[String]) -> async fn a_whole_workflow_inside_the_window_is_one_mail() { use time::macros::date; let (dir, store, workspace, admin) = waiting(5).await; - let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@iz.sh", "Emre").await; rules_for_a_workflow(&store, &workspace).await; let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); let board = store.board(&workspace).await.unwrap().unwrap(); let column_id = column_named(&store, &workspace, "Backlog").await; let created = store @@ -7876,7 +7876,7 @@ async fn a_whole_workflow_inside_the_window_is_one_mail() { assert_eq!(report.sent, 1, "one envelope for the whole workflow"); let sent = mailer.sent(); assert_eq!(sent.len(), 1); - assert_eq!(sent[0].to, "emre@izlek.sh"); + assert_eq!(sent[0].to, "emre@iz.sh"); assert_eq!( sent[0].subject, "Deadline set", "the newest thing that happened names the mail", @@ -7912,14 +7912,14 @@ async fn a_whole_workflow_inside_the_window_is_one_mail() { #[tokio::test] async fn a_column_put_right_inside_the_window_mails_only_where_the_card_ended_up() { let (dir, store, workspace, admin) = waiting(5).await; - let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@iz.sh", "Emre").await; let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; store.assign_task(&task, &mate).await.unwrap(); a_rule(&store, &workspace, "Done", "Card is done").await; a_rule(&store, &workspace, "In Progress", "Card is in progress").await; let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); let wrong = moved_to(&store, &workspace, &task, "Backlog", "Done", &admin).await; assert_eq!(engine.on_transition(&wrong).await.unwrap().sent, 0); let right = moved_to(&store, &workspace, &task, "Done", "In Progress", &admin).await; @@ -7951,14 +7951,14 @@ async fn a_column_put_right_inside_the_window_mails_only_where_the_card_ended_up #[tokio::test] async fn a_second_event_pushes_the_batch_out_again() { let (dir, store, workspace, admin) = waiting(5).await; - let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@iz.sh", "Emre").await; let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; store.assign_task(&task, &mate).await.unwrap(); a_rule(&store, &workspace, "Done", "Card is done").await; a_rule(&store, &workspace, "In Progress", "Card is in progress").await; let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); let first = moved_to(&store, &workspace, &task, "Backlog", "Done", &admin).await; engine.on_transition(&first).await.unwrap(); let due_then = the_one_row(&store).await.next_attempt_at.unwrap(); @@ -7980,7 +7980,7 @@ async fn a_second_event_pushes_the_batch_out_again() { } /// Reads the single pending row back. -async fn the_one_row(store: &TursoStore) -> izlek_core::store::MailSend { +async fn the_one_row(store: &TursoStore) -> iz_core::store::MailSend { let mut rows = store .sends_owed(OffsetDateTime::now_utc() + Duration::hours(2), 10) .await @@ -7995,7 +7995,7 @@ async fn the_one_row(store: &TursoStore) -> izlek_core::store::MailSend { #[tokio::test] async fn the_hold_has_a_ceiling_measured_from_the_oldest_mail() { let (dir, store, workspace, admin) = waiting(1).await; - let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@iz.sh", "Emre").await; let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; store.assign_task(&task, &mate).await.unwrap(); let rule = a_rule(&store, &workspace, "Done", "Card is done").await; @@ -8004,14 +8004,14 @@ async fn the_hold_has_a_ceiling_measured_from_the_oldest_mail() { // afternoon. let born = OffsetDateTime::now_utc() - Duration::minutes(10); store - .claim_send(&rule.id, "event-1", &task, "emre@izlek.sh", born, born) + .claim_send(&rule.id, "event-1", &task, "emre@iz.sh", born, born) .await .unwrap() .expect("a fresh row is claimed"); let far = OffsetDateTime::now_utc() + Duration::minutes(5); store - .hold_batch(&task, "emre@izlek.sh", far, Duration::minutes(4)) + .hold_batch(&task, "emre@iz.sh", far, Duration::minutes(4)) .await .unwrap(); @@ -8035,14 +8035,14 @@ async fn the_hold_has_a_ceiling_measured_from_the_oldest_mail() { #[tokio::test] async fn a_hold_never_pulls_a_leased_row_back_under_the_pass_that_took_it() { let (dir, store, workspace, admin) = waiting(1).await; - let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@iz.sh", "Emre").await; let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; store.assign_task(&task, &mate).await.unwrap(); let rule = a_rule(&store, &workspace, "Done", "Card is done").await; let now = OffsetDateTime::now_utc(); store - .claim_send(&rule.id, "event-1", &task, "emre@izlek.sh", now, now) + .claim_send(&rule.id, "event-1", &task, "emre@iz.sh", now, now) .await .unwrap() .expect("a fresh row is claimed"); @@ -8050,7 +8050,7 @@ async fn a_hold_never_pulls_a_leased_row_back_under_the_pass_that_took_it() { let taken = store .claim_sends_owed( now + Duration::seconds(1), - now + izlek_core::mail::LEASE, + now + iz_core::mail::LEASE, 10, ) .await @@ -8063,7 +8063,7 @@ async fn a_hold_never_pulls_a_leased_row_back_under_the_pass_that_took_it() { store .hold_batch( &task, - "emre@izlek.sh", + "emre@iz.sh", now + Duration::minutes(1), Duration::minutes(4), ) @@ -8079,7 +8079,7 @@ async fn a_hold_never_pulls_a_leased_row_back_under_the_pass_that_took_it() { store .hold_batch( &task, - "emre@izlek.sh", + "emre@iz.sh", now + Duration::minutes(30), Duration::hours(2), ) @@ -8092,19 +8092,19 @@ async fn a_hold_never_pulls_a_leased_row_back_under_the_pass_that_took_it() { let _ = std::fs::remove_dir_all(&dir); } -/// A workspace with no window is İzlek as it was: a trigger is a mail, sent +/// A workspace with no window is İz as it was: a trigger is a mail, sent /// the moment it is owed. #[tokio::test] async fn no_window_sends_each_trigger_as_it_happens() { let (dir, store, workspace, admin) = waiting(0).await; - let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@iz.sh", "Emre").await; let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; store.assign_task(&task, &mate).await.unwrap(); a_rule(&store, &workspace, "Done", "Card is done").await; a_rule(&store, &workspace, "In Progress", "Card is in progress").await; let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); let first = moved_to(&store, &workspace, &task, "Backlog", "Done", &admin).await; assert_eq!(engine.on_transition(&first).await.unwrap().sent, 1); let second = moved_to(&store, &workspace, &task, "Done", "In Progress", &admin).await; @@ -8119,8 +8119,8 @@ async fn no_window_sends_each_trigger_as_it_happens() { #[tokio::test] async fn a_batch_is_one_card_and_one_reader() { let (dir, store, workspace, admin) = waiting(5).await; - let emre = member(&store, &workspace, "emre@izlek.sh", "Emre").await; - let grace = member(&store, &workspace, "grace@izlek.sh", "Grace").await; + let emre = member(&store, &workspace, "emre@iz.sh", "Emre").await; + let grace = member(&store, &workspace, "grace@iz.sh", "Grace").await; let first = add_task(&store, &workspace, "Backlog", "First", None, &admin).await; let second = add_task(&store, &workspace, "Backlog", "Second", None, &admin).await; for task in [&first, &second] { @@ -8130,7 +8130,7 @@ async fn a_batch_is_one_card_and_one_reader() { a_rule(&store, &workspace, "Done", "Card is done").await; let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); for task in [&first, &second] { let crossing = moved_to(&store, &workspace, task, "Backlog", "Done", &admin).await; engine.on_transition(&crossing).await.unwrap(); @@ -8164,7 +8164,7 @@ async fn a_batch_is_one_card_and_one_reader() { assert_eq!( addressed .iter() - .filter(|line| line.contains("emre@izlek.sh")) + .filter(|line| line.contains("emre@iz.sh")) .count(), 2, ); @@ -8176,22 +8176,22 @@ async fn a_batch_is_one_card_and_one_reader() { #[tokio::test] async fn an_invitation_is_never_folded_into_a_batch() { let (dir, store, workspace, admin) = waiting(5).await; - let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@iz.sh", "Emre").await; let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; store.assign_task(&task, &mate).await.unwrap(); a_rule(&store, &workspace, "Done", "Card is done").await; store .queue_invite( - "emre@izlek.sh", + "emre@iz.sh", "Join the workspace", - "Your link: https://izlek.sh/join", + "Your link: https://iz.sh/join", OffsetDateTime::now_utc(), ) .await .unwrap(); let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); let crossing = moved_to(&store, &workspace, &task, "Backlog", "Done", &admin).await; engine.on_transition(&crossing).await.unwrap(); @@ -8218,14 +8218,14 @@ async fn an_invitation_is_never_folded_into_a_batch() { #[tokio::test] async fn a_refused_batch_is_retried_as_a_batch() { let (dir, store, workspace, admin) = waiting(5).await; - let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@iz.sh", "Emre").await; let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; store.assign_task(&task, &mate).await.unwrap(); a_rule(&store, &workspace, "Done", "Card is done").await; a_rule(&store, &workspace, "In Progress", "Card is in progress").await; let mailer = Remembering::refusing(vec![MailError::retryable("host is down")]); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); for (from, to) in [("Backlog", "Done"), ("Done", "In Progress")] { let crossing = moved_to(&store, &workspace, &task, from, to, &admin).await; engine.on_transition(&crossing).await.unwrap(); @@ -8274,7 +8274,7 @@ async fn a_refused_batch_is_retried_as_a_batch() { // owed, inside the same transaction as the write itself. // --------------------------------------------------------------------------- -use izlek_core::store::MailSend; +use iz_core::store::MailSend; /// A task carrying a meeting instant `clock` from now (or none), as the /// reminder tests keep needing. @@ -8348,8 +8348,8 @@ async fn set_reminder_lead(store: &TursoStore, workspace_id: &str, minutes: u32) #[tokio::test] async fn a_clocked_task_owes_each_assignee_one_reminder_before_the_meeting() { let (dir, store, workspace, admin) = shared().await; - let grace = member(&store, &workspace, "grace@izlek.sh", "Grace").await; - let emre = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let grace = member(&store, &workspace, "grace@iz.sh", "Grace").await; + let emre = member(&store, &workspace, "emre@iz.sh", "Emre").await; let now = OffsetDateTime::now_utc(); let clock = now + Duration::hours(2); let task = clocked_task(&store, &workspace, &admin, Some(clock)).await; @@ -8389,8 +8389,8 @@ async fn a_clocked_task_owes_each_assignee_one_reminder_before_the_meeting() { "the countdown names the meeting two hours out: {body}" ); } - assert_eq!(rows[0].recipient, "emre@izlek.sh"); - assert_eq!(rows[1].recipient, "grace@izlek.sh"); + assert_eq!(rows[0].recipient, "emre@iz.sh"); + assert_eq!(rows[1].recipient, "grace@iz.sh"); let _ = std::fs::remove_dir_all(&dir); } @@ -8398,7 +8398,7 @@ async fn a_clocked_task_owes_each_assignee_one_reminder_before_the_meeting() { async fn reminders_switched_off_owe_nobody() { let (dir, store, workspace, admin) = shared().await; set_reminder_lead(&store, &workspace, 0).await; - let mate = member(&store, &workspace, "grace@izlek.sh", "Grace").await; + let mate = member(&store, &workspace, "grace@iz.sh", "Grace").await; let clock = OffsetDateTime::now_utc() + Duration::hours(2); let task = clocked_task(&store, &workspace, &admin, Some(clock)).await; store.assign_task(&task, &mate).await.unwrap(); @@ -8413,7 +8413,7 @@ async fn reminders_switched_off_owe_nobody() { async fn the_reminder_falls_due_at_the_workspaces_own_lead() { let (dir, store, workspace, admin) = shared().await; set_reminder_lead(&store, &workspace, 60).await; - let mate = member(&store, &workspace, "grace@izlek.sh", "Grace").await; + let mate = member(&store, &workspace, "grace@iz.sh", "Grace").await; let clock = OffsetDateTime::now_utc() + Duration::hours(4); let task = clocked_task(&store, &workspace, &admin, Some(clock)).await; store.assign_task(&task, &mate).await.unwrap(); @@ -8430,7 +8430,7 @@ async fn the_reminder_falls_due_at_the_workspaces_own_lead() { #[tokio::test] async fn moving_the_clock_re_makes_the_reminders() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "grace@izlek.sh", "Grace").await; + let mate = member(&store, &workspace, "grace@iz.sh", "Grace").await; let task = clocked_task( &store, &workspace, @@ -8484,7 +8484,7 @@ async fn moving_the_clock_re_makes_the_reminders() { #[tokio::test] async fn clearing_the_clock_abandons_the_reminders() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "grace@izlek.sh", "Grace").await; + let mate = member(&store, &workspace, "grace@iz.sh", "Grace").await; let task = clocked_task( &store, &workspace, @@ -8520,7 +8520,7 @@ async fn clearing_the_clock_abandons_the_reminders() { #[tokio::test] async fn an_assignee_added_after_the_clock_gets_a_reminder() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "grace@izlek.sh", "Grace").await; + let mate = member(&store, &workspace, "grace@iz.sh", "Grace").await; let task = clocked_task( &store, &workspace, @@ -8540,8 +8540,8 @@ async fn an_assignee_added_after_the_clock_gets_a_reminder() { #[tokio::test] async fn an_assignee_removed_takes_their_reminder_with_them() { let (dir, store, workspace, admin) = shared().await; - let grace = member(&store, &workspace, "grace@izlek.sh", "Grace").await; - let emre = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let grace = member(&store, &workspace, "grace@iz.sh", "Grace").await; + let emre = member(&store, &workspace, "emre@iz.sh", "Emre").await; let task = clocked_task( &store, &workspace, @@ -8557,19 +8557,19 @@ async fn an_assignee_removed_takes_their_reminder_with_them() { let rows = reminders(&store, &task).await; assert!( rows.iter() - .any(|r| r.recipient == "grace@izlek.sh" && r.state == SendState::Abandoned), + .any(|r| r.recipient == "grace@iz.sh" && r.state == SendState::Abandoned), "the removed person's reminder was abandoned: {rows:?}" ); let still_owed = pending_reminders(&store, &task).await; assert_eq!(still_owed.len(), 1); - assert_eq!(still_owed[0].recipient, "emre@izlek.sh"); + assert_eq!(still_owed[0].recipient, "emre@iz.sh"); let _ = std::fs::remove_dir_all(&dir); } #[tokio::test] async fn finishing_a_task_abandons_its_reminders() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "grace@izlek.sh", "Grace").await; + let mate = member(&store, &workspace, "grace@iz.sh", "Grace").await; let task = clocked_task( &store, &workspace, @@ -8603,7 +8603,7 @@ async fn finishing_a_task_abandons_its_reminders() { #[tokio::test] async fn deleting_a_task_abandons_its_reminders() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "grace@izlek.sh", "Grace").await; + let mate = member(&store, &workspace, "grace@iz.sh", "Grace").await; let task = clocked_task( &store, &workspace, @@ -8626,7 +8626,7 @@ async fn deleting_a_task_abandons_its_reminders() { #[tokio::test] async fn a_clock_in_the_past_owes_nobody_a_warning() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "grace@izlek.sh", "Grace").await; + let mate = member(&store, &workspace, "grace@iz.sh", "Grace").await; let clock = OffsetDateTime::now_utc() - Duration::hours(1); let task = clocked_task(&store, &workspace, &admin, Some(clock)).await; store.assign_task(&task, &mate).await.unwrap(); @@ -8649,7 +8649,7 @@ async fn a_clocked_task_without_assignees_owes_nobody() { #[tokio::test] async fn a_meeting_already_inside_the_window_warns_the_moment_it_is_owed() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "grace@izlek.sh", "Grace").await; + let mate = member(&store, &workspace, "grace@iz.sh", "Grace").await; // Five minutes out, against a fifteen-minute lead: the due instant is // already past, so the row is born due now rather than in the past. let now = OffsetDateTime::now_utc(); @@ -8677,8 +8677,8 @@ async fn a_meeting_already_inside_the_window_warns_the_moment_it_is_owed() { #[tokio::test] async fn each_reminder_tells_the_meeting_in_its_own_recipients_clock() { let (dir, store, workspace, admin) = shared().await; - let grace = member(&store, &workspace, "grace@izlek.sh", "Grace").await; - let emre = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let grace = member(&store, &workspace, "grace@iz.sh", "Grace").await; + let emre = member(&store, &workspace, "emre@iz.sh", "Emre").await; // Emre reads the world three hours ahead of the stored UTC. store .set_preferences(&emre, "UTC+03:00", "dark", "en", "default") @@ -8697,14 +8697,14 @@ async fn each_reminder_tells_the_meeting_in_its_own_recipients_clock() { assert_eq!(rows.len(), 2); let grace_body = rows .iter() - .find(|r| r.recipient == "grace@izlek.sh") + .find(|r| r.recipient == "grace@iz.sh") .unwrap() .body .as_deref() .unwrap(); let emre_body = rows .iter() - .find(|r| r.recipient == "emre@izlek.sh") + .find(|r| r.recipient == "emre@iz.sh") .unwrap() .body .as_deref() @@ -8722,12 +8722,12 @@ async fn each_reminder_tells_the_meeting_in_its_own_recipients_clock() { #[tokio::test] async fn reminder_rows_survive_a_reopen() { - let dir = std::env::temp_dir().join(format!("izlek-test-{}", Ulid::new())); + let dir = std::env::temp_dir().join(format!("iz-test-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); - let path = dir.join("izlek.db").to_string_lossy().into_owned(); + let path = dir.join("iz.db").to_string_lossy().into_owned(); let store = TursoStore::open(&path, &dir.join("storage")).await.unwrap(); let (workspace, admin) = claim(&store).await; - let mate = member(&store, &workspace, "grace@izlek.sh", "Grace").await; + let mate = member(&store, &workspace, "grace@iz.sh", "Grace").await; let clock = OffsetDateTime::now_utc() + Duration::hours(2); let task = clocked_task(&store, &workspace, &admin, Some(clock)).await; store.assign_task(&task, &mate).await.unwrap(); @@ -8750,15 +8750,15 @@ async fn reminder_rows_survive_a_reopen() { #[tokio::test] async fn a_reminder_already_sent_is_never_queued_again() { let (dir, store, workspace, admin) = shared().await; - let grace = member(&store, &workspace, "grace@izlek.sh", "Grace").await; - let emre = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let grace = member(&store, &workspace, "grace@iz.sh", "Grace").await; + let emre = member(&store, &workspace, "emre@iz.sh", "Emre").await; let clock = OffsetDateTime::now_utc() + Duration::hours(2); let task = clocked_task(&store, &workspace, &admin, Some(clock)).await; store.assign_task(&task, &grace).await.unwrap(); store.assign_task(&task, &emre).await.unwrap(); let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); // The meeting is 15 minutes out from due, so a pass anywhere after that // delivers both reminders. let later = clock - Duration::minutes(14); @@ -8766,23 +8766,23 @@ async fn a_reminder_already_sent_is_never_queued_again() { // Any later write about the card re-derives the reminders. The two who // were reminded keep the rows that went out; nobody is minted a second. - let yusuf = member(&store, &workspace, "yusuf@izlek.sh", "Yusuf").await; + let yusuf = member(&store, &workspace, "yusuf@iz.sh", "Yusuf").await; store.assign_task(&task, &yusuf).await.unwrap(); let rows = reminders(&store, &task).await; let yusuf_rows: Vec<_> = rows .iter() - .filter(|r| r.recipient == "yusuf@izlek.sh") + .filter(|r| r.recipient == "yusuf@iz.sh") .collect(); assert_eq!(yusuf_rows.len(), 1, "the newcomer has one row: {rows:?}"); let served: Vec<_> = rows .iter() - .filter(|r| r.recipient != "yusuf@izlek.sh") + .filter(|r| r.recipient != "yusuf@iz.sh") .collect(); assert!( served.iter().all(|r| r.state != SendState::Pending), "nobody served is owed again: {served:?}" ); - for person in ["grace@izlek.sh", "emre@izlek.sh"] { + for person in ["grace@iz.sh", "emre@iz.sh"] { assert_eq!( served .iter() @@ -8794,7 +8794,7 @@ async fn a_reminder_already_sent_is_never_queued_again() { } let pending = pending_reminders(&store, &task).await; assert_eq!(pending.len(), 1, "only the newcomer is owed: {pending:?}"); - assert_eq!(pending[0].recipient, "yusuf@izlek.sh"); + assert_eq!(pending[0].recipient, "yusuf@iz.sh"); // And the queue itself repeats nothing: sweep after sweep re-delivers // nobody, whatever the writes in between did. Taking Yusuf off the card @@ -8815,25 +8815,25 @@ async fn a_reminder_already_sent_is_never_queued_again() { #[tokio::test] async fn a_reminder_failing_on_retries_is_not_minted_twice() { let (dir, store, workspace, admin) = shared().await; - let grace = member(&store, &workspace, "grace@izlek.sh", "Grace").await; + let grace = member(&store, &workspace, "grace@iz.sh", "Grace").await; let clock = OffsetDateTime::now_utc() + Duration::hours(2); let task = clocked_task(&store, &workspace, &admin, Some(clock)).await; store.assign_task(&task, &grace).await.unwrap(); let mailer = Remembering::refusing(vec![MailError::retryable("host is down")]); - let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://iz.sh"); let later = clock - Duration::minutes(14); assert_eq!(engine.deliver_owed(later, 10).await.unwrap().failed, 1); // The write between the sweeps finds Grace's reminder riding its own // retry clock, and leaves it exactly one row. - let emre = member(&store, &workspace, "emre@izlek.sh", "Emre").await; + let emre = member(&store, &workspace, "emre@iz.sh", "Emre").await; store.assign_task(&task, &emre).await.unwrap(); let rows = reminders(&store, &task).await; assert_eq!(rows.len(), 2, "one row per person: {rows:?}"); let grace_row = rows .iter() - .find(|r| r.recipient == "grace@izlek.sh") + .find(|r| r.recipient == "grace@iz.sh") .unwrap(); assert_eq!(grace_row.state, SendState::Failed); assert_eq!(grace_row.attempts, 1); @@ -8846,7 +8846,7 @@ async fn a_reminder_failing_on_retries_is_not_minted_twice() { let grace_mail = mailer .sent() .iter() - .filter(|m| m.to == "grace@izlek.sh") + .filter(|m| m.to == "grace@iz.sh") .count(); assert_eq!(grace_mail, 1, "{:?}", mailer.sent()); let _ = std::fs::remove_dir_all(&dir); @@ -8861,7 +8861,7 @@ async fn the_reminder_never_lands_at_or_after_the_deadline() { store .assign_task( &task, - &member(&store, &workspace, "grace@izlek.sh", "Grace").await, + &member(&store, &workspace, "grace@iz.sh", "Grace").await, ) .await .unwrap(); @@ -8882,7 +8882,7 @@ async fn the_reminder_never_lands_at_or_after_the_deadline() { store .assign_task( &task, - &member(&store, &workspace, "emre@izlek.sh", "Emre").await, + &member(&store, &workspace, "emre@iz.sh", "Emre").await, ) .await .unwrap(); @@ -8900,7 +8900,7 @@ async fn a_change_back_to_the_same_password_is_refused_and_signs_nobody_out() { let (_scratch, accounts, admin) = claimed().await; // A second browser holds a session the refused change must not touch. let other = accounts - .sign_in("ada@izlek.sh", "tide-tables-1892", "198.51.100.8") + .sign_in("ada@iz.sh", "tide-tables-1892", "198.51.100.8") .await .unwrap(); assert!(matches!( @@ -8923,7 +8923,7 @@ async fn a_change_back_to_the_same_password_is_refused_and_signs_nobody_out() { .is_some() ); accounts - .sign_in("ada@izlek.sh", "tide-tables-1892", "198.51.100.7") + .sign_in("ada@iz.sh", "tide-tables-1892", "198.51.100.7") .await .unwrap(); } @@ -8962,7 +8962,7 @@ async fn board_search_matches_keys_and_titles_in_place() { .task_key; // The human key, typed in any case, finds its card — and only its card. - let mut board = izlek_core::board::load(&scratch.store, &workspace) + let mut board = iz_core::board::load(&scratch.store, &workspace) .await .unwrap() .unwrap(); @@ -8986,7 +8986,7 @@ async fn board_search_matches_keys_and_titles_in_place() { ); // A title fragment, any case, the same story in the other column. - let mut board = izlek_core::board::load(&scratch.store, &workspace) + let mut board = iz_core::board::load(&scratch.store, &workspace) .await .unwrap() .unwrap(); @@ -9000,7 +9000,7 @@ async fn board_search_matches_keys_and_titles_in_place() { assert_eq!(progress.cards[0].id, wire); // A query nothing answers empties the board. - let mut board = izlek_core::board::load(&scratch.store, &workspace) + let mut board = iz_core::board::load(&scratch.store, &workspace) .await .unwrap() .unwrap(); @@ -9017,13 +9017,13 @@ async fn board_search_matches_keys_and_titles_in_place() { /// is the token's only carrier, so the test reads it like a recipient would. async fn queued_reset_token(store: &std::sync::Arc, email: &str) -> Option { let sends = store - .mail_queue(50, izlek_core::store::FeedPage::Newest) + .mail_queue(50, iz_core::store::FeedPage::Newest) .await .unwrap(); let body = sends .into_iter() .rev() - .find(|send| send.kind == izlek_core::store::SendKind::Notice && send.recipient == email) + .find(|send| send.kind == iz_core::store::SendKind::Notice && send.recipient == email) .and_then(|send| send.body)?; body.rsplit_once("/reset/") .and_then(|(_, rest)| rest.split_whitespace().next()) @@ -9033,33 +9033,33 @@ async fn queued_reset_token(store: &std::sync::Arc, email: &str) -> O #[tokio::test] async fn a_reset_link_is_mailed_only_to_a_known_address() { let (dir, store, workspace, _admin) = shared().await; - let _grace = member(&store, &workspace, "grace@izlek.sh", "Grace").await; + let _grace = member(&store, &workspace, "grace@iz.sh", "Grace").await; let store = store as std::sync::Arc; - let accounts = Accounts::new(store.clone(), "https://izlek.sh"); + let accounts = Accounts::new(store.clone(), "https://iz.sh"); // One ask for an address with an account, one without: the caller sees // two identical answers. accounts - .request_password_reset("grace@izlek.sh", "203.0.113.9") + .request_password_reset("grace@iz.sh", "203.0.113.9") .await .unwrap(); accounts - .request_password_reset("nobody@izlek.sh", "203.0.113.9") + .request_password_reset("nobody@iz.sh", "203.0.113.9") .await .unwrap(); let link = scalar( - &dir.join("izlek.db").to_string_lossy(), + &dir.join("iz.db").to_string_lossy(), "SELECT COUNT(*) FROM signin_link WHERE kind = 'reset'", ) .await; assert_eq!(link, 1, "only the known address gets a link"); assert!( - queued_reset_token(&store, "grace@izlek.sh").await.is_some(), + queued_reset_token(&store, "grace@iz.sh").await.is_some(), "the known address was mailed a reset link" ); assert!( - queued_reset_token(&store, "nobody@izlek.sh") + queued_reset_token(&store, "nobody@iz.sh") .await .is_none(), "the unknown address was mailed nothing" @@ -9072,15 +9072,15 @@ async fn a_reset_redeems_and_signs_the_other_browsers_out() { let (_scratch, accounts, _admin) = claimed().await; // A second browser, signed in before the reset. let before = accounts - .sign_in("ada@izlek.sh", "tide-tables-1892", "198.51.100.7") + .sign_in("ada@iz.sh", "tide-tables-1892", "198.51.100.7") .await .unwrap(); accounts - .request_password_reset("ada@izlek.sh", "203.0.113.9") + .request_password_reset("ada@iz.sh", "203.0.113.9") .await .unwrap(); - let token = queued_reset_token(accounts.store(), "ada@izlek.sh") + let token = queued_reset_token(accounts.store(), "ada@iz.sh") .await .expect("no reset mail queued"); @@ -9092,12 +9092,12 @@ async fn a_reset_redeems_and_signs_the_other_browsers_out() { // The old password is gone, the new one signs in. assert!(matches!( accounts - .sign_in("ada@izlek.sh", "tide-tables-1892", "198.51.100.11") + .sign_in("ada@iz.sh", "tide-tables-1892", "198.51.100.11") .await, Err(AccountError::Rejected) )); accounts - .sign_in("ada@izlek.sh", "chronometer-1761", "198.51.100.11") + .sign_in("ada@iz.sh", "chronometer-1761", "198.51.100.11") .await .unwrap(); // The browser that was signed in before the reset is out; the redeeming @@ -9122,10 +9122,10 @@ async fn a_reset_redeems_and_signs_the_other_browsers_out() { async fn a_reset_link_only_redeems_once() { let (_scratch, accounts, _admin) = claimed().await; accounts - .request_password_reset("ada@izlek.sh", "203.0.113.9") + .request_password_reset("ada@iz.sh", "203.0.113.9") .await .unwrap(); - let token = queued_reset_token(accounts.store(), "ada@izlek.sh") + let token = queued_reset_token(accounts.store(), "ada@iz.sh") .await .expect("no reset mail queued"); @@ -9144,14 +9144,14 @@ async fn a_reset_link_only_redeems_once() { #[tokio::test] async fn an_expired_reset_link_is_refused() { let (scratch, accounts, admin) = claimed().await; - let token = izlek_core::auth::Token::mint(); + let token = iz_core::auth::Token::mint(); scratch .store .create_signin_link( &admin.id, &token.hash(), time::OffsetDateTime::now_utc() - time::Duration::seconds(1), - izlek_core::store::LinkKind::Reset, + iz_core::store::LinkKind::Reset, ) .await .unwrap(); @@ -9168,14 +9168,14 @@ async fn each_link_redeems_only_on_its_own_screen() { let (scratch, accounts, admin) = claimed().await; // An invitation is not a reset: it must not spend itself where the other // browsers get signed out. - let join = izlek_core::auth::Token::mint(); + let join = iz_core::auth::Token::mint(); scratch .store .create_signin_link( &admin.id, &join.hash(), time::OffsetDateTime::now_utc() + SIGNIN_LINK_LIFETIME, - izlek_core::store::LinkKind::Join, + iz_core::store::LinkKind::Join, ) .await .unwrap(); @@ -9187,10 +9187,10 @@ async fn each_link_redeems_only_on_its_own_screen() { )); // And a reset link is not an invitation. accounts - .request_password_reset("ada@izlek.sh", "203.0.113.9") + .request_password_reset("ada@iz.sh", "203.0.113.9") .await .unwrap(); - let reset = queued_reset_token(accounts.store(), "ada@izlek.sh") + let reset = queued_reset_token(accounts.store(), "ada@iz.sh") .await .expect("no reset mail queued"); assert!(matches!( @@ -9204,21 +9204,21 @@ async fn each_link_redeems_only_on_its_own_screen() { #[tokio::test] async fn reset_asks_are_rate_limited_per_client_and_silenced_per_address() { let (dir, store, workspace, _admin) = shared().await; - let _grace = member(&store, &workspace, "grace@izlek.sh", "Grace").await; + let _grace = member(&store, &workspace, "grace@iz.sh", "Grace").await; let store = store as std::sync::Arc; - let accounts = Accounts::new(store.clone(), "https://izlek.sh"); + let accounts = Accounts::new(store.clone(), "https://iz.sh"); // One machine asks RATE_LIMIT times: every ask answers the same, and the // eleventh from that machine is refused by name. for _ in 0..RATE_LIMIT { accounts - .request_password_reset("grace@izlek.sh", "203.0.113.9") + .request_password_reset("grace@iz.sh", "203.0.113.9") .await .unwrap(); } assert!(matches!( accounts - .request_password_reset("grace@izlek.sh", "203.0.113.9") + .request_password_reset("grace@iz.sh", "203.0.113.9") .await, Err(AccountError::RateLimited) )); @@ -9226,11 +9226,11 @@ async fn reset_asks_are_rate_limited_per_client_and_silenced_per_address() { // the mailbox stays quiet: the address bucket caps the mail, not the // answer. accounts - .request_password_reset("grace@izlek.sh", "203.0.113.201") + .request_password_reset("grace@iz.sh", "203.0.113.201") .await .unwrap(); let queued = scalar( - &dir.join("izlek.db").to_string_lossy(), + &dir.join("iz.db").to_string_lossy(), "SELECT COUNT(*) FROM mail_send WHERE kind = 'notice'", ) .await; @@ -9241,7 +9241,7 @@ async fn reset_asks_are_rate_limited_per_client_and_silenced_per_address() { #[tokio::test] async fn a_delivered_reminder_writes_the_reminded_event() { let (dir, store, workspace, admin) = shared().await; - let grace = member(&store, &workspace, "grace@izlek.sh", "Grace").await; + let grace = member(&store, &workspace, "grace@iz.sh", "Grace").await; let clock = OffsetDateTime::now_utc() + Duration::hours(2); let task = clocked_task(&store, &workspace, &admin, Some(clock)).await; store.assign_task(&task, &grace).await.unwrap(); @@ -9249,14 +9249,14 @@ async fn a_delivered_reminder_writes_the_reminded_event() { let engine = Engine::new( store.clone() as std::sync::Arc, Remembering::taking_everything(), - "https://izlek.sh", + "https://iz.sh", ); let later = clock - Duration::minutes(14); assert_eq!(engine.deliver_owed(later, 10).await.unwrap().sent, 1); // The delivery wrote the trail line: on the meeting's card, about the // person the reminder landed on, with the system as the actor. - let path = dir.join("izlek.db").to_string_lossy().into_owned(); + let path = dir.join("iz.db").to_string_lossy().into_owned(); let events = scalar( &path, "SELECT COUNT(*) FROM activity WHERE kind = 'reminded' AND actor_id IS NULL", @@ -9322,7 +9322,7 @@ async fn board_search_folds_turkish_case() { .task_key; for query in ["iş", "İŞ", "is", "İS", "plan", "PLAN"] { - let mut board = izlek_core::board::load(&scratch.store, &workspace) + let mut board = iz_core::board::load(&scratch.store, &workspace) .await .unwrap() .unwrap(); @@ -9337,7 +9337,7 @@ async fn board_search_folds_turkish_case() { } // ASCII titles still answer, any case. - let mut board = izlek_core::board::load(&scratch.store, &workspace) + let mut board = iz_core::board::load(&scratch.store, &workspace) .await .unwrap() .unwrap(); @@ -9347,7 +9347,7 @@ async fn board_search_folds_turkish_case() { assert_eq!(card.id, wire); // The key keeps answering whatever case it is typed in. - let mut board = izlek_core::board::load(&scratch.store, &workspace) + let mut board = iz_core::board::load(&scratch.store, &workspace) .await .unwrap() .unwrap(); @@ -9362,7 +9362,7 @@ async fn board_search_folds_turkish_case() { #[tokio::test] async fn board_assigned_narrows_to_a_member_or_to_nobody() { let (scratch, workspace, admin) = workspace_with_admin().await; - let mate = member(&scratch.store, &workspace, "grace@izlek.sh", "Grace").await; + let mate = member(&scratch.store, &workspace, "grace@iz.sh", "Grace").await; let assigned_task = add_task( &scratch.store, &workspace, @@ -9387,7 +9387,7 @@ async fn board_assigned_narrows_to_a_member_or_to_nobody() { .await .unwrap(); - let mut board = izlek_core::board::load(&scratch.store, &workspace) + let mut board = iz_core::board::load(&scratch.store, &workspace) .await .unwrap() .unwrap(); @@ -9396,7 +9396,7 @@ async fn board_assigned_narrows_to_a_member_or_to_nobody() { let card = board.columns.iter().flat_map(|c| &c.cards).next().unwrap(); assert_eq!(card.id, assigned_task); - let mut board = izlek_core::board::load(&scratch.store, &workspace) + let mut board = iz_core::board::load(&scratch.store, &workspace) .await .unwrap() .unwrap(); @@ -9405,7 +9405,7 @@ async fn board_assigned_narrows_to_a_member_or_to_nobody() { let card = board.columns.iter().flat_map(|c| &c.cards).next().unwrap(); assert_eq!(card.id, loose_task); - let mut board = izlek_core::board::load(&scratch.store, &workspace) + let mut board = iz_core::board::load(&scratch.store, &workspace) .await .unwrap() .unwrap(); @@ -9456,8 +9456,8 @@ fn deep_zip(before: usize, after: usize) -> Vec { /// Whether the boot windows of `bytes` hold `marker` — the premise the deep /// zip's test stands on, checked rather than assumed. fn windows_hold(bytes: &[u8], marker: &[u8]) -> bool { - let head = &bytes[..bytes.len().min(izlek_core::store::sniff::HEAD_WINDOW as usize)]; - let tail = &bytes[bytes.len().saturating_sub(izlek_core::store::sniff::TAIL_WINDOW as usize)..]; + let head = &bytes[..bytes.len().min(iz_core::store::sniff::HEAD_WINDOW as usize)]; + let tail = &bytes[bytes.len().saturating_sub(iz_core::store::sniff::TAIL_WINDOW as usize)..]; head.windows(marker.len()).any(|w| w == marker) || tail.windows(marker.len()).any(|w| w == marker) } @@ -9486,9 +9486,9 @@ struct Planted { impl Planted { async fn plant(rows: &[(&str, &str, Vec)]) -> Self { - let dir = std::env::temp_dir().join(format!("izlek-resniff-{}", Ulid::new())); + let dir = std::env::temp_dir().join(format!("iz-resniff-{}", Ulid::new())); std::fs::create_dir_all(&dir).unwrap(); - let path = dir.join("izlek.db").to_str().unwrap().to_string(); + let path = dir.join("iz.db").to_str().unwrap().to_string(); drop(TursoStore::open(&path, &dir.join("storage")).await.unwrap()); let db = turso::Builder::new_local(&path).build().await.unwrap(); let conn = db.connect().unwrap(); diff --git a/crates/izlek-web/Cargo.toml b/crates/iz-web/Cargo.toml similarity index 92% rename from crates/izlek-web/Cargo.toml rename to crates/iz-web/Cargo.toml index 25bce65..39bf08c 100644 --- a/crates/izlek-web/Cargo.toml +++ b/crates/iz-web/Cargo.toml @@ -1,10 +1,10 @@ [package] -name = "izlek-web" +name = "iz-web" version.workspace = true edition.workspace = true license.workspace = true repository.workspace = true -description = "İzlek web app: topcoat UI, routes and the server" +description = "İz web app: topcoat UI, routes and the server" [dependencies] topcoat = { version = "0.6.2", default-features = false, features = [ @@ -19,7 +19,7 @@ topcoat = { version = "0.6.2", default-features = false, features = [ "multipart", "sse", ] } -izlek-core = { workspace = true, features = ["server"] } +iz-core = { workspace = true, features = ["server"] } serde.workspace = true serde_json.workspace = true time.workspace = true diff --git a/crates/izlek-web/build.rs b/crates/iz-web/build.rs similarity index 96% rename from crates/izlek-web/build.rs rename to crates/iz-web/build.rs index e818c22..f4d0af5 100644 --- a/crates/izlek-web/build.rs +++ b/crates/iz-web/build.rs @@ -31,5 +31,5 @@ fn main() { for byte in fingerprint { hex.push_str(&format!("{byte:02x}")); } - println!("cargo:rustc-env=IZLEK_STYLE_FINGERPRINT=sha256:{hex}"); + println!("cargo:rustc-env=IZ_STYLE_FINGERPRINT=sha256:{hex}"); } diff --git a/crates/izlek-web/src/auth.rs b/crates/iz-web/src/auth.rs similarity index 96% rename from crates/izlek-web/src/auth.rs rename to crates/iz-web/src/auth.rs index ed0c5e6..e910e79 100644 --- a/crates/izlek-web/src/auth.rs +++ b/crates/iz-web/src/auth.rs @@ -1,14 +1,14 @@ //! The account surface: claiming the workspace, first sign-in from an invited //! link, signing in and out, and changing a password. //! -//! Ported from `izlek-web/src/auth.rs`. Every mutating call answers a browser +//! Ported from `iz-web/src/auth.rs`. Every mutating call answers a browser //! without script the same way: a 303 back to wherever the form was posted //! from, with the refusal (if any) serialized as the body so //! [`crate::server::carry_refusal_on_redirect`] can carry it onto that //! redirect's query. -use izlek_core::accounts::SESSION_LIFETIME; -use izlek_core::detail::ActivityKind; +use iz_core::accounts::SESSION_LIFETIME; +use iz_core::detail::ActivityKind; use serde::{Deserialize, Serialize}; use topcoat::Result; use topcoat::context::Cx; @@ -25,7 +25,7 @@ use crate::settings::encode_q; /// The workspace has exactly one name and no screen that sets it, so it is a /// constant rather than a field nobody was shown. -pub const WORKSPACE_NAME: &str = "İzlek"; +pub const WORKSPACE_NAME: &str = "İz"; /// The name and address an invitation was made out to. #[derive(Clone, Debug, Serialize)] @@ -43,7 +43,7 @@ pub struct Invited { /// Shared by the `/api/invitation` route and the `/join/{token}` page: both /// answer the same question, one for a hydrated caller and one to render. pub async fn invited_by_token(cx: &Cx, token: &str) -> Result> { - use izlek_core::auth::hash_token; + use iz_core::auth::hash_token; use time::OffsetDateTime; let store = accounts(cx).store().clone(); @@ -144,7 +144,7 @@ async fn sign_in(cx: &Cx, Form(input): Form) -> Redirect { redirect(cx, None) } Err(error) => { - if !matches!(error, izlek_core::accounts::AccountError::RateLimited) { + if !matches!(error, iz_core::accounts::AccountError::RateLimited) { let _ = accounts(cx) .store() .record_event( @@ -268,7 +268,7 @@ async fn change_password(cx: &Cx, Form(input): Form) -> Redi struct InviteMemberForm { email: String, display_name: String, - role: izlek_core::Role, + role: iz_core::Role, } /// Admin creates an account with a name and an address and no password. The @@ -276,7 +276,7 @@ struct InviteMemberForm { /// /// A caller with script reads the address straight off the JSON body, same /// as always. A plain form post has no such reader, so — same as -/// `resend_link` (`izlek-web/src/settings.rs`) — it lands back on Settings +/// `resend_link` (`iz-web/src/settings.rs`) — it lands back on Settings /// instead: `mailed=
` on success, `refusal=&on=invite_member` /// otherwise. #[route(POST "/api/invite_member")] @@ -345,7 +345,7 @@ async fn invitation(cx: &Cx, Form(input): Form) -> Result Result> { - use izlek_core::auth::hash_token; + use iz_core::auth::hash_token; use time::OffsetDateTime; let store = accounts(cx).store().clone(); @@ -353,7 +353,7 @@ pub async fn reset_by_token(cx: &Cx, token: &str) -> Result> { let Some(link) = store.signin_link_by_hash(&digest).await? else { return Ok(None); }; - if link.kind != izlek_core::store::LinkKind::Reset + if link.kind != iz_core::store::LinkKind::Reset || !link.is_usable(OffsetDateTime::now_utc()) { return Ok(None); diff --git a/crates/izlek-web/src/board.rs b/crates/iz-web/src/board.rs similarity index 94% rename from crates/izlek-web/src/board.rs rename to crates/iz-web/src/board.rs index f342407..3c9450e 100644 --- a/crates/izlek-web/src/board.rs +++ b/crates/iz-web/src/board.rs @@ -6,8 +6,8 @@ //! the server — a drag's only client-side memory is the browser's own drag //! session (`dataTransfer`), read back by the column that catches the drop. -use izlek_core::board::{DeadlineState, Moved, TaskCard, day_label}; -use izlek_core::store::{NewTask, User}; +use iz_core::board::{DeadlineState, Moved, TaskCard, day_label}; +use iz_core::store::{NewTask, User}; use time::{Date, OffsetDateTime}; use topcoat::Result; use topcoat::context::Cx; @@ -66,7 +66,7 @@ async fn move_card_shared( Ok(Moved::Unchanged) => Ok(None), Ok(Moved::Stale) => Ok(Some(Refusal::MovedAlready)), Ok(Moved::Held) => Ok(Some(Refusal::SubtasksOpen)), - Err(izlek_core::store::StoreError::NotFound) => Ok(Some(Refusal::NotFound)), + Err(iz_core::store::StoreError::NotFound) => Ok(Some(Refusal::NotFound)), Err(error) => { eprintln!("store error: {error}"); Ok(Some(Refusal::Unavailable)) @@ -93,7 +93,7 @@ async fn create_task_shared( if title.is_empty() { return Ok(Some(Refusal::EmptyTitle)); } - let zone = izlek_core::detail::parse_zone(&user.timezone); + let zone = iz_core::detail::parse_zone(&user.timezone); let time = match crate::detail::combine_clock(clock_hour, clock_minute) { Ok(time) => time, Err(refusal) => return Ok(Some(refusal)), @@ -231,7 +231,7 @@ fn valid_sort(sort: Option<&str>) -> &'static str { } /// The `?tag=` filter: an id only counts while it names a tag on this /// board — a stale or hand-edited query string falls back to all. -fn valid_tag(tag: Option<&str>, tags: &[izlek_core::store::Tag]) -> Option { +fn valid_tag(tag: Option<&str>, tags: &[iz_core::store::Tag]) -> Option { tag.and_then(|id| tags.iter().find(|t| t.id == id).map(|t| t.id.clone())) } @@ -254,7 +254,7 @@ fn searched(query: Option<&str>) -> Option { .map(str::to_string) } -/// `deadline` is the order [`izlek_core::board::load`] already hands back +/// `deadline` is the order [`iz_core::board::load`] already hands back /// (soonest first); the other two re-order in place here so core stays free /// of a UI sort preference. `created` reads the task id, a ULID, which sorts /// lexically by the moment it was minted — newest first. @@ -288,7 +288,7 @@ async fn board_columns( }; let lang = Lang::from_code(&user.language); let store = accounts(cx).store().clone(); - let Some(mut view_data) = izlek_core::board::load(store.as_ref(), &user.workspace_id).await? + let Some(mut view_data) = iz_core::board::load(store.as_ref(), &user.workspace_id).await? else { return view! { cx => @@ -306,7 +306,7 @@ async fn board_columns( } let today = OffsetDateTime::now_utc().date(); let may_write = user.role.can_write_tasks(); - let zone = izlek_core::detail::parse_zone(&user.timezone); + let zone = iz_core::detail::parse_zone(&user.timezone); let all_columns: Vec<(String, String)> = view_data .columns @@ -326,7 +326,7 @@ async fn board_columns( async fn render_column( cx: &Cx, - column: izlek_core::board::ColumnView, + column: iz_core::board::ColumnView, today: Date, zone: time::UtcOffset, may_write: bool, @@ -507,7 +507,7 @@ async fn render_card( /// card's `@contextmenu` calls into this same global, by the menu's id. /// /// Also registers the board page's own `Escape` resolvers on -/// `window.__izlekEsc`: the datepicker panel (priority 20 — below the +/// `window.__izEsc`: the datepicker panel (priority 20 — below the /// dropdown panel and the user-menu, above only the card menu; the modal /// chain steps aside on its own (its resolver returns false while a /// datepick is open), which is how the datepicker still closes before the @@ -519,25 +519,25 @@ async fn card_menu_script(cx: &Cx) -> Result { use topcoat::view::Unescaped; const JS: &str = "\ (function () { \ - if (window.__izlekCardMenu) { return; } \ - window.__izlekCardMenu = true; \ + if (window.__izCardMenu) { return; } \ + window.__izCardMenu = true; \ function closeCardMenus() { document.querySelectorAll('.card-menu-open').forEach(function (el) { el.classList.remove('card-menu-open'); }); } \ - window.__izlekOpenCardMenu = function (e, id) { \ + window.__izOpenCardMenu = function (e, id) { \ closeCardMenus(); \ var menu = document.getElementById(id); \ if (!menu) { return; } \ menu.style.left = e.clientX + 'px'; \ menu.style.top = e.clientY + 'px'; \ - window.__izlekOwn(menu, ['card-menu-open'], ['style']); \ + window.__izOwn(menu, ['card-menu-open'], ['style']); \ }; \ document.addEventListener('click', closeCardMenus); \ - window.__izlekEsc.register(20, function () { \ + window.__izEsc.register(20, function () { \ var datepick = document.querySelector('.datepick-pop > .edit-toggle:checked'); \ if (!datepick) { return false; } \ datepick.checked = false; \ return true; \ }); \ - window.__izlekEsc.register(10, function () { \ + window.__izEsc.register(10, function () { \ var menu = document.querySelector('.card-menu-open'); \ if (!menu) { return false; } \ closeCardMenus(); \ @@ -547,13 +547,13 @@ async fn card_menu_script(cx: &Cx) -> Result { var card = e.target.closest ? e.target.closest('.card[data-menu-id]') : null; \ if (!card) { return; } \ e.preventDefault(); \ - window.__izlekOpenCardMenu(e, card.dataset.menuId); \ + window.__izOpenCardMenu(e, card.dataset.menuId); \ }); \ document.addEventListener('dragstart', function (e) { \ var card = e.target.closest ? e.target.closest('.card[data-task-id]') : null; \ if (!card) { return; } \ - e.dataTransfer.setData('izlek-task', card.dataset.taskId); \ - e.dataTransfer.setData('izlek-from', card.dataset.fromColumn); \ + e.dataTransfer.setData('iz-task', card.dataset.taskId); \ + e.dataTransfer.setData('iz-from', card.dataset.fromColumn); \ }); \ document.addEventListener('dragover', function (e) { \ if (e.target.closest && e.target.closest('.board-columns')) { e.preventDefault(); } \ @@ -562,10 +562,10 @@ async fn card_menu_script(cx: &Cx) -> Result { var column = e.target.closest ? e.target.closest('.column-cards') : null; \ if (!column) { return; } \ e.preventDefault(); \ - var task = e.dataTransfer.getData('izlek-task'); \ - var from = e.dataTransfer.getData('izlek-from'); \ - if (task && window.__izlekPost) { \ - window.__izlekPost('/api/move_card', { task_id: task, from_column_id: from, to_column_id: column.id }); \ + var task = e.dataTransfer.getData('iz-task'); \ + var from = e.dataTransfer.getData('iz-from'); \ + if (task && window.__izPost) { \ + window.__izPost('/api/move_card', { task_id: task, from_column_id: from, to_column_id: column.id }); \ } \ }); \ })();"; @@ -582,16 +582,16 @@ async fn search_script(cx: &Cx) -> Result { use topcoat::view::Unescaped; const JS: &str = "\ (function () { \ - if (window.__izlekBoardSearch) { return; } \ - window.__izlekBoardSearch = true; \ + if (window.__izBoardSearch) { return; } \ + window.__izBoardSearch = true; \ var timer = null; \ var last = (document.querySelector('.field-box-search input[name=q]') || {}).value || ''; \ function fire() { \ var el = document.querySelector('.field-box-search input[name=q]'); \ - if (!el || !el.form || !window.__izlekQuery || el.value === last) { return; } \ + if (!el || !el.form || !window.__izQuery || el.value === last) { return; } \ last = el.value; \ - window.__izlekKeep = true; \ - window.__izlekQuery((el.form.getAttribute('action') || window.location.pathname) + '?' + new URLSearchParams(new FormData(el.form)).toString()); \ + window.__izKeep = true; \ + window.__izQuery((el.form.getAttribute('action') || window.location.pathname) + '?' + new URLSearchParams(new FormData(el.form)).toString()); \ } \ document.addEventListener('input', function (e) { \ var el = e.target; \ @@ -640,7 +640,7 @@ fn sort_label(sort: &str, lang: Lang) -> &'static str { pub async fn board_page(cx: &Cx, user: &User) -> Result { let view_data = { let store = accounts(cx).store().clone(); - izlek_core::board::load(store.as_ref(), &user.workspace_id).await? + iz_core::board::load(store.as_ref(), &user.workspace_id).await? }; let lang = Lang::from_code(&user.language); let Some(mut view_data) = view_data else { diff --git a/crates/izlek-web/src/detail.rs b/crates/iz-web/src/detail.rs similarity index 98% rename from crates/izlek-web/src/detail.rs rename to crates/iz-web/src/detail.rs index f47d70e..576fa54 100644 --- a/crates/izlek-web/src/detail.rs +++ b/crates/iz-web/src/detail.rs @@ -16,11 +16,11 @@ //! (`after_activity`/`after_freeing`) from the old version is carried over //! unchanged. -use izlek_core::board::{DeadlineState, Person}; -use izlek_core::detail::{ +use iz_core::board::{DeadlineState, Person}; +use iz_core::detail::{ Comment, DeletionCost, DependencyEdge, TaskDetail, TaskFacts, moment_label_in, parse_zone, }; -use izlek_core::store::{Store, StoreError, User}; +use iz_core::store::{Store, StoreError, User}; use serde::{Deserialize, Serialize}; use time::{Date, UtcOffset}; use topcoat::Result; @@ -42,13 +42,13 @@ pub struct LinkTarget { } /// The person the current browser is signed in as, wired the same as -/// `izlek-web/src/auth.rs`'s `Me` so [`fetch_task`]'s answer keeps its shape. +/// `iz-web/src/auth.rs`'s `Me` so [`fetch_task`]'s answer keeps its shape. #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct Me { pub id: String, pub display_name: String, pub email: String, - pub role: izlek_core::Role, + pub role: iz_core::Role, pub language: String, pub has_photo: bool, } @@ -89,7 +89,7 @@ pub struct DetailSnapshot { pub may_administer: bool, /// Every tag on this workspace's board, in the admin's hand-set order — /// the tag field reads both its options and its current value from here. - pub tags: Vec, + pub tags: Vec, } /// One send's fate, joined to the sends of its decision's event. @@ -281,7 +281,7 @@ async fn load_snapshot( cx: &Cx, task_id: &str, ) -> Result> { - use izlek_core::detail::load; + use iz_core::detail::load; use time::OffsetDateTime; let user = match require_user(cx).await { @@ -378,7 +378,7 @@ async fn load_snapshot( let decisions = store.decisions_for_task(&detail.id, 10).await?; let sends = store.sends_for_task(&detail.id, 50).await?; - let mut columns_cache: std::collections::HashMap> = + let mut columns_cache: std::collections::HashMap> = std::collections::HashMap::new(); let mut notifications = Vec::with_capacity(decisions.len()); for decision in decisions { @@ -402,7 +402,7 @@ async fn load_snapshot( .iter() .filter(|s| s.event_id.as_deref() == Some(decision.event_id.as_str())) .map(|send| { - use izlek_core::store::SendState; + use iz_core::store::SendState; let (state, state_kind) = match send.state { SendState::Pending => (t(lang, Key::QueueStatePending), "pending"), SendState::Failed if send.attempts == 0 => { @@ -641,7 +641,7 @@ async fn set_task_tag(cx: &Cx, Form(input): Form) -> Redirect { &input.task_id, Some(&actor.id), None, - &izlek_core::detail::ActivityKind::Other("tagged".to_string()), + &iz_core::detail::ActivityKind::Other("tagged".to_string()), &tag.name, time::OffsetDateTime::now_utc(), ) @@ -652,7 +652,7 @@ async fn set_task_tag(cx: &Cx, Form(input): Form) -> Redirect { /// Puts someone on a task. A Viewer can neither do this nor be the target. #[route(POST "/api/assign")] async fn assign(cx: &Cx, Form(input): Form) -> Redirect { - use izlek_core::detail::ActivityKind; + use iz_core::detail::ActivityKind; use time::OffsetDateTime; let (actor, _) = match writer_and_task(cx, &input.task_id).await { @@ -688,7 +688,7 @@ async fn assign(cx: &Cx, Form(input): Form) -> Redirect { #[route(POST "/api/unassign")] async fn unassign(cx: &Cx, Form(input): Form) -> Redirect { - use izlek_core::detail::ActivityKind; + use iz_core::detail::ActivityKind; use time::OffsetDateTime; let (actor, _) = match writer_and_task(cx, &input.task_id).await { @@ -723,7 +723,7 @@ async fn unassign(cx: &Cx, Form(input): Form) -> Redirect { /// transaction that would have written it. #[route(POST "/api/link_tasks")] async fn link_tasks(cx: &Cx, Form(input): Form) -> Redirect { - use izlek_core::detail::ActivityKind; + use iz_core::detail::ActivityKind; use time::OffsetDateTime; let (actor, _) = match writer_and_task(cx, &input.task_id).await { @@ -761,7 +761,7 @@ async fn link_tasks(cx: &Cx, Form(input): Form) -> Redirect { /// rules engine — still has something to read. #[route(POST "/api/unlink_tasks")] async fn unlink_tasks(cx: &Cx, Form(input): Form) -> Redirect { - use izlek_core::detail::ActivityKind; + use iz_core::detail::ActivityKind; use time::OffsetDateTime; let (actor, _) = match writer_and_task(cx, &input.task_id).await { @@ -795,7 +795,7 @@ async fn unlink_tasks(cx: &Cx, Form(input): Form) -> Redirect { /// first column, the way a card dropped on the board's first column would. #[route(POST "/api/create_subtask")] async fn create_subtask(cx: &Cx, Form(input): Form) -> Redirect { - use izlek_core::store::NewTask; + use iz_core::store::NewTask; let (actor, parent) = match writer_and_task(cx, &input.parent_id).await { Ok(pair) => pair, @@ -836,7 +836,7 @@ async fn create_subtask(cx: &Cx, Form(input): Form) -> Redirect /// `parent_id` is the second. One handler, because it is one write. #[route(POST "/api/set_parent")] async fn set_parent(cx: &Cx, Form(input): Form) -> Redirect { - use izlek_core::detail::ActivityKind; + use iz_core::detail::ActivityKind; use time::OffsetDateTime; let (actor, task) = match writer_and_task(cx, &input.task_id).await { @@ -994,7 +994,7 @@ async fn delete_file(cx: &Cx, Form(input): Form) -> Redirect { &attachment.task_id, Some(&user.id), None, - &izlek_core::detail::ActivityKind::FileRemoved, + &iz_core::detail::ActivityKind::FileRemoved, &attachment.file_name, time::OffsetDateTime::now_utc(), ) @@ -1147,10 +1147,10 @@ pub(crate) mod glyph { /// `Escape` for everything the task modal renders, topmost first: viewer → /// delete confirm (`confirm=delete` in URL) → open edit popovers → modal -/// itself — one resolver at priority 90 on `window.__izlekEsc` (table on +/// itself — one resolver at priority 90 on `window.__izEsc` (table on /// `layout.rs`'s `escape_manager_script`); an open datepick popover returns /// false, leaving it to `board.rs`'s priority-100 resolver. Closing never -/// navigates: `layout.rs`'s `__izlekCloseViewer`/`__izlekCloseModal` drop +/// navigates: `layout.rs`'s `__izCloseViewer`/`__izCloseModal` drop /// the overlay's DOM and rewrite the URL, the board underneath is already /// rendered. Focused native media controls swallow `Escape` before the page /// ever sees the key, so focus landing on the viewer's audio/video is moved @@ -1159,17 +1159,17 @@ async fn escape_closes(cx: &Cx) -> Result { use topcoat::view::Unescaped; const JS: &str = "\ (function () { \ - if (window.__izlekEscModal) { return; } \ - window.__izlekEscModal = true; \ - window.__izlekEsc.register(90, function () { \ + if (window.__izEscModal) { return; } \ + window.__izEscModal = true; \ + window.__izEsc.register(90, function () { \ if (document.querySelector('.datepick-pop .edit-toggle:checked')) { return false; } \ if (document.querySelector('.viewer-scrim')) { \ - window.__izlekCloseViewer(); \ + window.__izCloseViewer(); \ return true; \ } \ var confirm = document.querySelector('details.confirm-details[open]'); \ if (confirm && window.location.search.indexOf('confirm=delete') !== -1) { \ - window.__izlekCloseModal(); \ + window.__izCloseModal(); \ return true; \ } \ var toggled = false; \ @@ -1183,7 +1183,7 @@ async fn escape_closes(cx: &Cx) -> Result { return true; \ } \ if (document.querySelector('.modal-scrim')) { \ - window.__izlekCloseModal(); \ + window.__izCloseModal(); \ return true; \ } \ return false; \ @@ -1194,7 +1194,7 @@ async fn escape_closes(cx: &Cx) -> Result { var panel = media.closest('.viewer'); \ if (panel) { panel.focus(); } \ }, true); \ - document.addEventListener('click', function (e) { var confirm = document.querySelector('details.confirm-details[open]'); if (!confirm) { return; } var panel = confirm.querySelector('.confirm'); if (panel && !panel.contains(e.target) && !e.target.closest('summary')) { if (window.location.search.indexOf('confirm=delete') !== -1) { window.__izlekCloseModal(); } else { confirm.removeAttribute('open'); } } }, true); \ + document.addEventListener('click', function (e) { var confirm = document.querySelector('details.confirm-details[open]'); if (!confirm) { return; } var panel = confirm.querySelector('.confirm'); if (panel && !panel.contains(e.target) && !e.target.closest('summary')) { if (window.location.search.indexOf('confirm=delete') !== -1) { window.__izCloseModal(); } else { confirm.removeAttribute('open'); } } }, true); \ document.addEventListener('click', function (e) { \ document.querySelectorAll('.edit-toggle:checked').forEach(function (toggle) { \ if (toggle.closest('.datepick-pop')) { return; } \ @@ -1312,7 +1312,7 @@ async fn deadline_control( (Some(at), Some(parts)) => format!("{} {:02}:{:02}", parts.date, at.hour(), at.minute()), (Some(at), None) => format!( "{} {:02}:{:02}", - izlek_core::board::day_label(at.date()), + iz_core::board::day_label(at.date()), at.hour(), at.minute() ), @@ -1418,8 +1418,8 @@ pub(crate) async fn datepicker_grid( /// bytes and wrote the old date back over the pick; the label it reverted, /// the client-built grid it emptied, the month nav's `data-year`/`data-month` /// it swept. So the pick declares itself the client's the moment it happens -/// (`__izlekOwn(input, [], ['value'])`, and the panel's month attrs when -/// `render` first sets them), and an `izlek:wire` repair pass re-derives the +/// (`__izOwn(input, [], ['value'])`, and the panel's month attrs when +/// `render` first sets them), and an `iz:wire` repair pass re-derives the /// rest from that value: the label of a popover holding an unsaved pick, and /// the grid of one standing open. The pass runs on every wire — a repair, /// not an install; closed popovers with no unsaved pick are left to the @@ -1430,8 +1430,8 @@ pub(crate) async fn datepicker_script(cx: &Cx, lang: Lang) -> Result { let (months, weekdays) = datepicker_js_literals(lang); let js = format!( "(function() {{\ - if (window.__izlekDatepick) {{ return; }}\ - window.__izlekDatepick = true;\ + if (window.__izDatepick) {{ return; }}\ + window.__izDatepick = true;\ var MONTHS = {months};\ var WEEKDAYS = {weekdays};\ function pad(n) {{ return String(n).padStart(2, '0'); }}\ @@ -1443,7 +1443,7 @@ pub(crate) async fn datepicker_script(cx: &Cx, lang: Lang) -> Result { if (!input) {{ return; }}\ var sel = parseYmd(input.value);\ var t = todayYmd();\ - if (!panel.dataset.year) {{ var base = sel || t; panel.dataset.year = base.y; panel.dataset.month = base.m; window.__izlekOwn(panel, [], ['data-year', 'data-month']); }}\ + if (!panel.dataset.year) {{ var base = sel || t; panel.dataset.year = base.y; panel.dataset.month = base.m; window.__izOwn(panel, [], ['data-year', 'data-month']); }}\ var y = +panel.dataset.year, m = +panel.dataset.month;\ panel.querySelector('.datepick-title').textContent = MONTHS[m - 1] + ' ' + y;\ panel.querySelector('.datepick-weekdays').innerHTML = WEEKDAYS.map(function(w) {{ return '' + w + ''; }}).join('');\ @@ -1463,7 +1463,7 @@ pub(crate) async fn datepicker_script(cx: &Cx, lang: Lang) -> Result { var input = panel.querySelector('.datepick-input');\ if (!input) {{ return; }}\ input.value = ymd ? (ymd.y + '-' + pad(ymd.m) + '-' + pad(ymd.d)) : '';\ - window.__izlekOwn(input, [], ['value']);\ + window.__izOwn(input, [], ['value']);\ if (!ymd) {{ ['clock_hour', 'clock_minute'].forEach(function (name) {{ var box = panel.querySelector('[name=' + name + ']'); if (!box) {{ return; }} box.value = ''; var trig = box.__ddTrigger; if (trig) {{ trig.textContent = box.options[0].textContent; trig.setAttribute('aria-expanded', 'false'); }} var drop = box.__ddPanel; if (drop) {{ drop.classList.remove('dd-open'); drop.querySelectorAll('.dd-option-selected').forEach(function (r) {{ r.classList.remove('dd-option-selected'); r.setAttribute('aria-selected', 'false'); }}); }} }}); }} \ var pop = panel.closest('.datepick-pop');\ var label = pop.querySelector('.datepick-label');\ @@ -1490,14 +1490,14 @@ pub(crate) async fn datepicker_script(cx: &Cx, lang: Lang) -> Result { if (!!hour.value !== !!minute.value) {{ return; }}\ if (input.form) {{ input.form.requestSubmit(); }}\ }});\ - document.addEventListener('izlek:wire', function () {{\ + document.addEventListener('iz:wire', function () {{\ document.querySelectorAll('.datepick-pop').forEach(function (pop) {{\ var panel = pop.querySelector('.datepick-panel');\ if (!panel) {{ return; }}\ var toggle = pop.querySelector('.edit-toggle');\ if (toggle && toggle.checked) {{ render(panel); }}\ var input = panel.querySelector('.datepick-input');\ - if (!input || !input.__izlekMine || input.__izlekMine.a.indexOf('value') === -1) {{ return; }}\ + if (!input || !input.__izMine || input.__izMine.a.indexOf('value') === -1) {{ return; }}\ var label = pop.querySelector('.datepick-label');\ if (label) {{ speak(label, parseYmd(input.value)); }}\ }});\ @@ -1646,8 +1646,8 @@ async fn link_picker(cx: &Cx, task_id: &str, linkable: &[LinkTarget], lang: Lang /// board's columns the page already has. async fn subtask_row( cx: &Cx, - part: &izlek_core::detail::SubtaskLine, - columns: &[izlek_core::Column], + part: &iz_core::detail::SubtaskLine, + columns: &[iz_core::Column], may_write: bool, lang: Lang, ) -> Result { @@ -1783,14 +1783,14 @@ async fn dep_row( /// Uploads are insert-only — nothing in the store rewrites an attachment — /// so the stamp is the one moment the bytes have ever changed, and a URL /// that carries it can be cached as if it were the bytes themselves. -fn attachment_stamp(attachment: &izlek_core::store::Attachment) -> String { +fn attachment_stamp(attachment: &iz_core::store::Attachment) -> String { (attachment.uploaded_at.unix_timestamp_nanos() / 1_000).to_string() } async fn file_chip( cx: &Cx, task_id: &str, - file: &izlek_core::detail::FileLine, + file: &iz_core::detail::FileLine, me: &Me, may_write: bool, lang: Lang, @@ -2221,7 +2221,7 @@ pub async fn task_modal(cx: &Cx, task_id: &str, confirm_delete: bool, tab: Tab) for entry in &detail.activity {
(entry.moment_in(zone)) - (entry.actor.as_ref().map(|person| person.display_name.clone()).unwrap_or_else(|| "İzlek".to_string())) + (entry.actor.as_ref().map(|person| person.display_name.clone()).unwrap_or_else(|| "İz".to_string())) (entry.sentence())
} @@ -2339,18 +2339,18 @@ pub async fn task_modal(cx: &Cx, task_id: &str, confirm_delete: bool, tab: Tab) /// `