Skip to content

Commit

Permalink
fix(caldav): fixed initial sync and double processing
Browse files Browse the repository at this point in the history
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
  • Loading branch information
SebastianKrupinski committed Jul 30, 2024
1 parent c5796d3 commit 0eb6cda
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions apps/dav/lib/CalDAV/CalDavBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -2420,12 +2420,10 @@ public function getChangesForCalendar($calendarId, $syncToken, $syncLevel, $limi
if ($initialSync) {
$qb = $this->db->getQueryBuilder();
$qb->select('uri')
->from('calendarchanges')
->from('calendarobjects')
->where($qb->expr()->eq('calendarid', $qb->createNamedParameter($calendarId)))
->andWhere($qb->expr()->eq('calendartype', $qb->createNamedParameter($calendarType)))
->groupBy('uri')
// forced (PARAM_INT) is needed for doctrine with Sqlite, for the value to be used as an integer without quotes
->having($qb->expr()->lt($qb->func()->max('operation'), $qb->createNamedParameter(3, $qb::PARAM_INT)));
->andWhere($qb->expr()->isNull('deleted_at'));
} else {
$qb = $this->db->getQueryBuilder();
$qb->select('uri', $qb->func()->max('operation'))
Expand Down

0 comments on commit 0eb6cda

Please sign in to comment.