diff --git a/CHANGELOG.md b/CHANGELOG.md index e2c30025..694b07d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ If you are upgrading from v0.16.x, replace the binary (or run `docker pull`). If - OIDC: `ECDSA` private key support for `SEC1` format. - PostgreSQL: Include error chain in error messages. - Prometheus: event counters are exported with incorrect metric names. +- Registry: Changing the type of an existing account from `user` to `group` panics. ## [0.16.11] - 2026-06-25 diff --git a/crates/jmap/src/registry/mapping/principal.rs b/crates/jmap/src/registry/mapping/principal.rs index d8dc5765..0594ed4e 100644 --- a/crates/jmap/src/registry/mapping/principal.rs +++ b/crates/jmap/src/registry/mapping/principal.rs @@ -245,7 +245,14 @@ pub(crate) async fn validate_account( true } - _ => unreachable!(), + (Account::User(_), AccountUpdate::Update(Account::Group(_))) + | (Account::Group(_), AccountUpdate::Update(Account::User(_))) => { + return Ok(Err(SetError::invalid_properties() + .with_property(Property::Type) + .with_description( + "Cannot change the type of an existing account.", + ))); + } }; let mut result = if validate_permissions {