Reminders on iOS only syncs on second start

60 views
Skip to first unread message

Arno Gramatke

unread,
Oct 2, 2015, 7:52:18 AM10/2/15
to SabreDAV Discussion
Hi everybody,

I switched to SabreDAV no too long ago for CalDAV and CardDAV (mainly with Mac OS X and iOS devices). So far everything - except one detail - is working fine.

The one thing that doesn't work as expected is syncing of Reminders in iOS in a shared account, i.e. an account that is used by multiple users using the same user name and password.

When I create a new Reminder on device A (running iOS 9.0.2) the CalDAV entry is created correctly (checked in SabreDAV's web interface). When I now open Reminders on device B (iOS 9.0.2) apparently the Reminders.app does not synchronize with SabreDAV. I have to close the app once and start it again immediately for the sync to start. Did anybody else experience this or some similar behavior?

Here is my configuration which is almost identical to the "groupwareserver.php" from SabreDAV.

=== groupwareserver.php ===
<?php

/**
 * This server combines both CardDAV and CalDAV functionality into a single
 * server. It is assumed that the server runs at the root of a HTTP domain (be
 * that a domainname-based vhost or a specific TCP port.
 *
 * This example also assumes that you're using SQLite and the database has
 * already been setup (along with the database tables).
 *
 * You may choose to use MySQL instead, just change the PDO connection
 * statement.
 */

/**
 * UTC or GMT is easy to work with, and usually recommended for any
 * application.
 */
date_default_timezone_set('Europe/Berlin');

/**
 * Make sure this setting is turned on and reflect the root url for your WebDAV
 * server.
 *
 * This can be for example the root / or a complete path to your server script.
 */
$baseUri = '/groupwareserver.php';

/**
 * Database
 *
 * Feel free to switch this to MySQL, it will definitely be better for higher
 * concurrency.
 */
$pdo = new PDO('mysql:dbname=sabredav', 'XXX', 'XXX');
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

/**
 * Mapping PHP errors to exceptions.
 *
 * While this is not strictly needed, it makes a lot of sense to do so. If an
 * E_NOTICE or anything appears in your code, this allows SabreDAV to intercept
 * the issue and send a proper response back to the client (HTTP/1.1 500).
 */
function exception_error_handler($errno, $errstr, $errfile, $errline) {
    throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
}
set_error_handler("exception_error_handler");

// Autoloader
require_once '../../sabredav/vendor/autoload.php';

/**
 * The backends. Yes we do really need all of them.
 *
 * This allows any developer to subclass just any of them and hook into their
 * own backend systems.
 */
$authBackend      = new \Sabre\DAV\Auth\Backend\PDO($pdo);
$principalBackend = new \Sabre\DAVACL\PrincipalBackend\PDO($pdo);
$carddavBackend   = new \Sabre\CardDAV\Backend\PDO($pdo);
$caldavBackend    = new \Sabre\CalDAV\Backend\PDO($pdo);

/**
 * The directory tree
 *
 * Basically this is an array which contains the 'top-level' directories in the
 * WebDAV server.
 */
$nodes = [
    // /principals
    new \Sabre\CalDAV\Principal\Collection($principalBackend),
    // /calendars
    new \Sabre\CalDAV\CalendarRoot($principalBackend, $caldavBackend),
    // /addressbook
    new \Sabre\CardDAV\AddressBookRoot($principalBackend, $carddavBackend),
];

// The object tree needs in turn to be passed to the server class
$server = new \Sabre\DAV\Server($nodes);
if (isset($baseUri)) $server->setBaseUri($baseUri);

// Plugins
$server->addPlugin(new \Sabre\DAV\Auth\Plugin($authBackend));
$server->addPlugin(new \Sabre\DAV\Browser\Plugin());
$server->addPlugin(new \Sabre\CalDAV\Plugin());
$server->addPlugin(new \Sabre\CalDAV\Schedule\Plugin());
$server->addPlugin(new \Sabre\CalDAV\Subscriptions\Plugin());
$server->addPlugin(new \Sabre\CardDAV\Plugin());
$server->addPlugin(new \Sabre\DAVACL\Plugin());
$server->addPlugin(new \Sabre\DAV\Sync\Plugin());

// And off we go!
$server->exec();

===

Thanks for your help!

Arno

Arno Gramatke

unread,
Oct 2, 2015, 7:54:51 AM10/2/15
to SabreDAV Discussion
My current installation is SabreDAV 3.0.4 installed via Composer.

Dominik Tobschall

unread,
Oct 2, 2015, 8:04:32 AM10/2/15
to sabredav...@googlegroups.com
Hi Arno,

I am not sure if this is actually an issue with sabre/dav or anything custom in your setup. Reminders.app relies on Calendar.app to do the actual sync (that was at least the case in prior iOS versions - not 100% sure about iOS9), so starting Reminders.app doesn't necessarily trigger a sync. Starting Calendar.app does though, so whenever you start Calendar.app and then Reminders.app, you should see that the refresh happened (Forcing a sync is also possible in Calendars.app by tapping "Calendars" and then doing a "Pull to refresh").

Cheers
Dominik
--
You received this message because you are subscribed to the Google Groups "SabreDAV Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sabredav-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sabredav-discuss/a5cda04b-19ac-4636-9fd0-046214453d1d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Evert Pot

unread,
Oct 3, 2015, 2:48:09 AM10/3/15
to SabreDAV Discussion


On Friday, October 2, 2015 at 1:52:18 PM UTC+2, Arno Gramatke wrote:
Hi everybody,

I switched to SabreDAV no too long ago for CalDAV and CardDAV (mainly with Mac OS X and iOS devices). So far everything - except one detail - is working fine.

The one thing that doesn't work as expected is syncing of Reminders in iOS in a shared account, i.e. an account that is used by multiple users using the same user name and password.

When I create a new Reminder on device A (running iOS 9.0.2) the CalDAV entry is created correctly (checked in SabreDAV's web interface). When I now open Reminders on device B (iOS 9.0.2) apparently the Reminders.app does not synchronize with SabreDAV. I have to close the app once and start it again immediately for the sync to start. Did anybody else experience this or some similar behavior?


Thats for the details and your server.php!

How long are you waiting for the reminders to show up on the second device? iOS occasionally polls for new items, so items never show up immediately. Closing and re-opening an app does generally force a resync, as you've noticed yourself.

Evert

Arno Gramatke

unread,
Oct 5, 2015, 4:38:32 AM10/5/15
to SabreDAV Discussion
Hi Dominik,

thanks for your reply. That makes sense, i.e. I do understand why it is working the way it is. It doesn't make sense so much from a usability point of view, though. But this is something Apple needs to look at, I think. ;-)

Nevertheless, I made one more observation: The account I've been testing with was a reminders only account and the calendar part wasn't being used and therefore not enabled in the iOS settings for this account. After enabling the calendar for this account syncing looks much more reliable for the reminders, too. Without this, it looked like the account wasn't synched when doing a pull to refresh in Calendar.app. But this is very much guesswork after trying different settings.

So, after all, I think I am good with using the "Pull to refresh" once in a while from Calendar.app.

Thanks again
Arno

Arno Gramatke

unread,
Oct 5, 2015, 4:41:07 AM10/5/15
to SabreDAV Discussion
Hi Evert,

the update interval was set to manual. So the updates wouldn't show up, until I open the Reminders.app twice in a short time. But I think Dominik's advice to use Calendar.app to force a sync will work for me.

The only strange thing is that the Reminders.app doesn't start a sync immediately, but only after reopening it.

Thanks
Arno

Arno Gramatke

unread,
Oct 5, 2015, 4:44:32 AM10/5/15
to SabreDAV Discussion
By the way: Calendar.app and Reminders.app on Mac OS X seem to work the same way as the iOS version when it comes to syncing. Forcing a sync in Calendar.app also refreshes the Reminders.app.
Reply all
Reply to author
Forward
0 new messages