Spam filter performance and accuracy improvements (part 4)

This commit is contained in:
mdecimus
2025-12-03 19:26:28 +01:00
parent e127ac0067
commit 50dce48a85
111 changed files with 1714 additions and 635 deletions

View File

@@ -43,7 +43,12 @@ pub(crate) async fn migrate_addressbook_v013(server: &Server, account_id: u32) -
for document_id in document_ids.iter() {
let Some(archive) = server
.archive(account_id, Collection::AddressBook, document_id)
.store()
.get_value::<Archive<AlignedBytes>>(ValueKey::archive(
account_id,
Collection::AddressBook,
document_id,
))
.await
.caused_by(trc::location!())?
else {

View File

@@ -74,7 +74,12 @@ pub(crate) async fn migrate_calendar_v013(server: &Server, account_id: u32) -> t
for document_id in document_ids.iter() {
let Some(archive) = server
.archive(account_id, Collection::Calendar, document_id)
.store()
.get_value::<Archive<AlignedBytes>>(ValueKey::archive(
account_id,
Collection::Calendar,
document_id,
))
.await
.caused_by(trc::location!())?
else {

View File

@@ -37,7 +37,12 @@ pub(crate) async fn migrate_contacts_v013(server: &Server, account_id: u32) -> t
for document_id in document_ids.iter() {
let Some(archive) = server
.archive(account_id, Collection::ContactCard, document_id)
.store()
.get_value::<Archive<AlignedBytes>>(ValueKey::archive(
account_id,
Collection::ContactCard,
document_id,
))
.await
.caused_by(trc::location!())?
else {

View File

@@ -89,7 +89,12 @@ pub(crate) async fn migrate_calendar_events_v012(server: &Server) -> trc::Result
for document_id in document_ids.iter() {
let Some(archive) = server
.archive(account_id, Collection::CalendarEvent, document_id)
.store()
.get_value::<Archive<AlignedBytes>>(ValueKey::archive(
account_id,
Collection::CalendarEvent,
document_id,
))
.await
.caused_by(trc::location!())?
else {

View File

@@ -77,7 +77,12 @@ pub(crate) async fn migrate_calendar_events_v013(
for document_id in document_ids.iter() {
let Some(archive) = server
.archive(account_id, Collection::CalendarEvent, document_id)
.store()
.get_value::<Archive<AlignedBytes>>(ValueKey::archive(
account_id,
Collection::CalendarEvent,
document_id,
))
.await
.caused_by(trc::location!())?
else {
@@ -151,11 +156,12 @@ pub(crate) async fn migrate_calendar_scheduling_v013(
for document_id in document_ids.iter() {
let Some(archive) = server
.archive(
.store()
.get_value::<Archive<AlignedBytes>>(ValueKey::archive(
account_id,
Collection::CalendarEventNotification,
document_id,
)
))
.await
.caused_by(trc::location!())?
else {

View File

@@ -36,7 +36,12 @@ pub(crate) async fn migrate_push_subscriptions_v013(
for push_id in &push_ids {
match server
.archive(account_id, Collection::PushSubscription, push_id)
.store()
.get_value::<Archive<AlignedBytes>>(ValueKey::archive(
account_id,
Collection::PushSubscription,
push_id,
))
.await
{
Ok(Some(legacy)) => match legacy.deserialize_untrusted::<PushSubscriptionV2>() {

View File

@@ -32,7 +32,12 @@ pub(crate) async fn migrate_sieve_v013(server: &Server, account_id: u32) -> trc:
for script_id in &script_ids {
match server
.archive(account_id, Collection::SieveScript, script_id)
.store()
.get_value::<Archive<AlignedBytes>>(ValueKey::archive(
account_id,
Collection::SieveScript,
script_id,
))
.await
{
Ok(Some(legacy)) => match legacy.deserialize_untrusted::<SieveScriptV2>() {