This article originally appeared in TidBITS on 2009-09-17 at 9:40 a.m.
The permanent URL for this article is:
Include images: Off

Preventing Duplicate Calendar Events in iPhone OS 3.1

by Michael E. Cohen

The calendar syncing capabilities of the iPhone (and its sibling, the iPod touch) have been evolving quickly, and in many ways for the better, but the latest enhancements to these capabilities can create an unexpected problem for users. Specifically, calendar syncing using iPhone OS 3.1 (the most recent version, as of this writing) can all too easily lead to duplicate calendar events on your device. Since these changes threw a bit of a monkey wrench into my in-progress update to "Take Control of Syncing Data in Leopard [1]," I wanted to share what I've discovered.

The underlying cause for these duplicate events is complicated, involving MobileMe, iTunes, and how read-only subscribed calendars in iCal sync to your shiny handheld device. To understand what's going on, you need to know something about how calendar syncing on the iPhone/iPod touch has changed over time.

Also, keep in mind that I'm talking about two types of calendars here:

iPhone OS 2.x -- In iPhone OS 2.x, you could sync your iCal calendars with your device in two ways:

Therefore, if you wanted to choose which calendars to sync with your device, or if you wanted any subscribed read-only calendars from iCal on your device, you had to sync the device using iTunes - and lose the benefits of push syncing.

iPhone OS 3.0 -- Apple's next major update to the iPhone OS eliminated the either/or choice between MobileMe and iTunes syncing and allowed you to sync your device using both methods. To accommodate this enhancement, changes were made in how the iPhone and iPod touch displayed calendars, as follows:

This was a significant improvement because it allowed you to do the following:

However, there was also the possibility of duplicate event confusion, because you could choose to sync the same calendar both with MobileMe and with iTunes. When you did that, a version of the calendar ended up both in the From My Mac collection and in the MobileMe collection. When you viewed All Calendars on your device, you would see events from that doubly synced calendar twice: one from each of the two collections.

So, if you synced with MobileMe, you had to make sure not to sync any of your self-created calendars with iTunes and only use iTunes to sync the calendars that MobileMe didn't sync. (Moral: with great power comes great responsibility. I'm sure I've heard that somewhere before.)

iPhone OS 3.1 -- The just-released iPhone OS 3.1 finally syncs your read-only subscribed calendars directly from MobileMe, eliminating the need to use iTunes syncing to get read-only subscribed calendars on your device.

(Note that read-only subscribed calendars have always synced with MobileMe from one Mac to another, but iPhone OS 3.1 can now access this information directly from MobileMe. Some might argue that the iPhone and iPod touch should have been able to do this all along.)

Unfortunately, you still can't choose which calendars are included when you sync with MobileMe - it remains an all-or-nothing proposition. However, now "all" includes all of your read-only subscribed calendars from iCal as well as all the calendars you have created in iCal. As a result, if you want to pick which calendars to sync, you have to return to the same solution that you used with the iPhone 2.x firmware. That is, you need to choose to sync your device only with MobileMe (and sync all of your calendars) or only with iTunes (and choose which of your calendars to sync).

The Hidden Gotcha -- Sounds reasonable, right? Not so fast, seeker: there's a hidden gotcha lurking in the current implementation of calendar syncing. This problem affects iPhone and iPod touch users who have previously synced their calendars using iTunes but who now want to sync only with MobileMe.

Here's the gotcha: when you turn off calendar syncing in iTunes to switch to MobileMe, those calendars that were in the From My Mac collection on your device are not deleted from your device. Instead, they are moved to an On My iPhone collection (this collection has a different name on the iPod touch, but serves the same purpose).

As a result, when you look at All Calendars on your device, you still see duplicate events: those events from the old calendars in the On My iPhone collection, as well as those events that reach your device over the air from MobileMe. Nor is there currently a way to delete the calendars in the On My iPhone collection. Curses!

Kludging the Gotcha -- Luckily, I've figured out a workaround, albeit a clumsy one, that can eliminate such duplicates:

  1. In iCal, create a new empty calendar (give it an obvious name, like "Empty Calendar").
  2. In iTunes, sync only that empty calendar with your device (if you have turned off iTunes syncing, you have to turn it back on, of course, for this step). When you sync, the From My Mac collection will now contain only that empty calendar.

The MobileMe collection on your device will still list the empty calendar, of course, but, since it contains no entries, you won't see any duplicate entries when you view the All Calendars collection on your device. Later, if you turn off calendar syncing in iTunes, the empty calendar will move to the On My iPhone collection, where it will still be harmless.

(Note that if you have turned syncing off in iTunes so that you have an On My iPhone calendar collection, turning iTunes syncing back on replaces the On My iPhone collection with From My Mac. This From My Mac collection now contains the set of calendars you are currently syncing with iTunes.)

Maybe someday, if some future version of iTunes or the iPhone OS provides the capability to delete calendars from the On My iPhone collection, you can eliminate this empty placeholder calendar. However, even if that feature never appears, at least you won't be seeing misleading duplicate events on your device.