Outlook sync improvements.

This commit is contained in:
Burak Kaan Köse
2025-10-12 16:23:33 +02:00
parent 309e891594
commit 7ca6a65559
22 changed files with 853 additions and 111 deletions
@@ -87,6 +87,14 @@ public interface IOutlookChangeProcessor : IDefaultChangeProcessor
/// <returns>New identifier if success.</returns>
Task UpdateFolderDeltaSynchronizationIdentifierAsync(Guid folderId, string deltaSynchronizationIdentifier);
/// <summary>
/// Updates the initial synchronization completion status for a folder.
/// Used to track whether mail ids have been queued for initial sync.
/// </summary>
/// <param name="folderId">Folder id</param>
/// <param name="isCompleted">Whether initial sync is completed</param>
Task UpdateFolderInitialSyncCompletedAsync(Guid folderId, bool isCompleted);
/// <summary>
/// Outlook may expire folder's delta token after a while.
/// Recommended action for this scenario is to reset token and do full sync.
@@ -38,6 +38,9 @@ public class OutlookChangeProcessor(IDatabaseService databaseService,
public Task UpdateFolderDeltaSynchronizationIdentifierAsync(Guid folderId, string synchronizationIdentifier)
=> Connection.ExecuteAsync("UPDATE MailItemFolder SET DeltaToken = ? WHERE Id = ?", synchronizationIdentifier, folderId);
public Task UpdateFolderInitialSyncCompletedAsync(Guid folderId, bool isCompleted)
=> Connection.ExecuteAsync("UPDATE MailItemFolder SET IsInitialSyncCompleted = ? WHERE Id = ?", isCompleted, folderId);
public async Task ManageCalendarEventAsync(Event calendarEvent, AccountCalendar assignedCalendar, MailAccount organizerAccount)
{
// We parse the occurrences based on the parent event.