Fixing an issue where DeleteAsync calls expect PK.

This commit is contained in:
Burak Kaan Köse
2025-12-25 17:21:23 +01:00
parent 8a68fafedf
commit f6e94e89c9
6 changed files with 8 additions and 8 deletions
+3 -3
View File
@@ -83,7 +83,7 @@ public class AccountService : BaseDatabaseService, IAccountService
}
await Connection.ExecuteAsync("UPDATE MailAccount SET MergedInboxId = NULL WHERE MergedInboxId = ?", mergedInboxId).ConfigureAwait(false);
await Connection.DeleteAsync<MergedInbox>(mergedInbox).ConfigureAwait(false);
await Connection.DeleteAsync<MergedInbox>(mergedInbox.Id).ConfigureAwait(false);
// Change the startup entity id if it was the merged inbox.
// Take the first account as startup account.
@@ -290,9 +290,9 @@ public class AccountService : BaseDatabaseService, IAccountService
await Connection.Table<CustomServerInformation>().DeleteAsync(a => a.AccountId == account.Id);
if (account.Preferences != null)
await Connection.DeleteAsync<MailAccountPreferences>(account.Preferences);
await Connection.DeleteAsync<MailAccountPreferences>(account.Preferences.Id);
await Connection.DeleteAsync<MailAccount>(account);
await Connection.DeleteAsync<MailAccount>(account.Id);
await _mimeFileService.DeleteUserMimeCacheAsync(account.Id).ConfigureAwait(false);
+1 -1
View File
@@ -45,7 +45,7 @@ public class CalendarService : BaseDatabaseService, ICalendarService
await Connection.ExecuteAsync(
"DELETE FROM CalendarItem WHERE CalendarId = ? AND AccountId = ?",
accountCalendar.Id, accountCalendar.AccountId);
await Connection.DeleteAsync<AccountCalendar>(accountCalendar);
await Connection.DeleteAsync<AccountCalendar>(accountCalendar.Id);
WeakReferenceMessenger.Default.Send(new CalendarListDeleted(accountCalendar));
}
+1 -1
View File
@@ -97,7 +97,7 @@ public class ContactService : BaseDatabaseService, IContactService
if (contact != null && !contact.IsRootContact)
{
await Connection.DeleteAsync<AccountContact>(contact).ConfigureAwait(false);
await Connection.DeleteAsync<AccountContact>(contact.Address).ConfigureAwait(false);
}
}
+1 -1
View File
@@ -508,7 +508,7 @@ public class FolderService : BaseDatabaseService, IFolderService
_logger.Debug("Deleting folder {FolderName}", folder.FolderName);
await Connection.DeleteAsync<MailItemFolder>(folder).ConfigureAwait(false);
await Connection.DeleteAsync<MailItemFolder>(folder.Id).ConfigureAwait(false);
// Delete all existing mails from this folder.
await Connection.ExecuteAsync("DELETE FROM MailCopy WHERE FolderId = ?", folder.Id);
+1 -1
View File
@@ -557,7 +557,7 @@ public class MailService : BaseDatabaseService, IMailService
_logger.Debug("Deleting mail {Id} from folder {FolderName}", mailCopy.Id, mailCopy.AssignedFolder.FolderName);
await Connection.DeleteAsync<MailCopy>(mailCopy).ConfigureAwait(false);
await Connection.DeleteAsync<MailCopy>(mailCopy.UniqueId).ConfigureAwait(false);
// If there are no more copies exists of the same mail, delete the MIME file as well.
var isMailExists = await IsMailExistsAsync(mailCopy.Id).ConfigureAwait(false);
+1 -1
View File
@@ -50,7 +50,7 @@ public class SignatureService(IDatabaseService databaseService) : BaseDatabaseSe
public async Task<AccountSignature> DeleteSignatureAsync(AccountSignature signature)
{
await Connection.DeleteAsync<AccountSignature>(signature);
await Connection.DeleteAsync<AccountSignature>(signature.Id);
return signature;
}