Fix Registry: Reload SieveUserScript and SieveSystemScript entries after they are modified or deleted

This commit is contained in:
Maurus Decimus
2026-05-08 08:49:14 +02:00
parent d950bf5f56
commit fb21c15f22
2 changed files with 32 additions and 5 deletions

View File

@@ -22,6 +22,7 @@ If you are upgrading from v0.16.x, replace the binary (or run `docker pull`). If
- ACME:
- Include apex domains when requesting certificates for subdomains.
- Use the public suffix list to determine the zone name when no origin is provided.
- Registry: Reload `SieveUserScript` and `SieveSystemScript` entries after they are modified or deleted.
## [0.16.4] - 2026-05-05

View File

@@ -28,8 +28,11 @@ use crate::registry::{
},
};
use common::{
Server, auth::AccessToken, cache::invalidate::CacheInvalidationBuilder,
expr::if_block::BootstrapExprExt, ipc::CacheInvalidation,
Server,
auth::AccessToken,
cache::invalidate::CacheInvalidationBuilder,
expr::if_block::BootstrapExprExt,
ipc::{BroadcastEvent, CacheInvalidation, RegistryChange},
};
use http_proto::HttpSessionData;
use jmap_proto::{
@@ -656,9 +659,8 @@ impl RegistrySet for Server {
.await
.caused_by(trc::location!())?
{
cache_invalidator.invalidate(
CacheInvalidation::AccessToken(sharee_id),
);
cache_invalidator
.invalidate(CacheInvalidation::AccessToken(sharee_id));
}
schedule_account_destruction(set.server, id, account).await?;
@@ -679,6 +681,30 @@ impl RegistrySet for Server {
// Finalize cache invalidation
self.invalidate_caches(cache_invalidator).await?;
// Sieve scripts: refresh the in-memory compiled script maps
if matches!(
object_type,
ObjectType::SieveUserScript | ObjectType::SieveSystemScript
) && (!set.response.created.is_empty()
|| !set.response.updated.is_empty()
|| !set.response.destroyed.is_empty())
{
let result = Box::pin(
set.server
.reload_registry(RegistryChange::Reload(object_type)),
)
.await?;
if !result.has_errors() {
set.server
.cluster_broadcast(BroadcastEvent::RegistryChange(
RegistryChange::Reload(object_type),
))
.await;
} else {
result.log();
}
}
Ok(set.into_response())
}
ObjectType::ArfExternalReport