diff --git a/app/src/main/java/org/tasks/caldav/CaldavSynchronizer.kt b/app/src/main/java/org/tasks/caldav/CaldavSynchronizer.kt index c6cb71006..63e4afe31 100644 --- a/app/src/main/java/org/tasks/caldav/CaldavSynchronizer.kt +++ b/app/src/main/java/org/tasks/caldav/CaldavSynchronizer.kt @@ -276,7 +276,7 @@ class CaldavSynchronizer @Inject constructor( } } caldavDao - .getObjects(caldavCalendar.uuid!!) + .getRemoteObjects(caldavCalendar.uuid!!) .subtract(members.map { it.hrefName() }) .takeIf { it.isNotEmpty() } ?.let { diff --git a/app/src/main/java/org/tasks/data/CaldavDao.kt b/app/src/main/java/org/tasks/data/CaldavDao.kt index bbc03aaae..98c70b006 100644 --- a/app/src/main/java/org/tasks/data/CaldavDao.kt +++ b/app/src/main/java/org/tasks/data/CaldavDao.kt @@ -209,10 +209,10 @@ SELECT EXISTS(SELECT 1 @Query("SELECT * FROM caldav_lists WHERE cdl_uuid = :uuid LIMIT 1") abstract suspend fun getCalendar(uuid: String): CaldavCalendar? - @Query("SELECT cd_object FROM caldav_tasks WHERE cd_calendar = :calendar AND cd_deleted = 0") - abstract suspend fun getObjects(calendar: String): List + @Query("SELECT cd_object FROM caldav_tasks WHERE cd_calendar = :calendar AND cd_deleted = 0 AND cd_last_sync > 0") + abstract suspend fun getRemoteObjects(calendar: String): List - @Query("SELECT cd_remote_id FROM caldav_tasks WHERE cd_calendar = :calendar AND cd_deleted = 0") + @Query("SELECT cd_remote_id FROM caldav_tasks WHERE cd_calendar = :calendar AND cd_deleted = 0 AND cd_last_sync > 0") abstract suspend fun getRemoteIds(calendar: String): List suspend fun getTasksByRemoteId(calendar: String, remoteIds: List): List =