Don't delete unpushed tasks

pull/1790/head
Alex Baker 3 years ago
parent 302a9f5d7f
commit 39438dd8b7

@ -276,7 +276,7 @@ class CaldavSynchronizer @Inject constructor(
}
}
caldavDao
.getObjects(caldavCalendar.uuid!!)
.getRemoteObjects(caldavCalendar.uuid!!)
.subtract(members.map { it.hrefName() })
.takeIf { it.isNotEmpty() }
?.let {

@ -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<String>
@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<String>
@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<String>
suspend fun getTasksByRemoteId(calendar: String, remoteIds: List<String>): List<Long> =

Loading…
Cancel
Save