diff --git a/crates/rhema-claw/src/forge.rs b/crates/rhema-claw/src/forge.rs index f97bf92..679752f 100644 --- a/crates/rhema-claw/src/forge.rs +++ b/crates/rhema-claw/src/forge.rs @@ -161,7 +161,7 @@ pub fn resolve_watch_credential( .filter(|account| host_matches(host, account.url.as_deref())) .find_map(|account| { let secret = accounts.secret(&account.id).ok()??; - (secret.kind == SecretKind::Token).then(|| WatchCredential { + (secret.kind == SecretKind::Token).then_some(WatchCredential { token: secret.value, login: account.username, }) diff --git a/crates/rhema-claw/src/handler.rs b/crates/rhema-claw/src/handler.rs index 4d351aa..e4a1f80 100644 --- a/crates/rhema-claw/src/handler.rs +++ b/crates/rhema-claw/src/handler.rs @@ -929,11 +929,8 @@ mod tests { #[test] fn an_account_watch_resolves_the_client_a_repo_watch_would_have() { let watches = Arc::new(ClawStore::in_memory().expect("store opens")); - watches - .add_account_watch("gitea", Some("https://git.example"), "acct-1") - .expect("account watch lands"); let accounts = Arc::new(rhema_identity::VolatileIdentityStore::new()); - accounts + let account = accounts .put( rhema_identity::AccountDraft::new( "kosmos", @@ -944,6 +941,11 @@ mod tests { .with_username("kosmos"), ) .expect("account lands"); + // The watch row names the id the store actually assigned: a + // fabricated id is a row that resolves nothing. + watches + .add_account_watch("gitea", Some("https://git.example"), &account.id) + .expect("account watch lands"); let registry = Arc::new( crate::backends::BackendRegistry::new( vec![crate::backends::Backend::headless(