mozilla-b2g/gaia — pull request #24572 by millermedeiros (2014-09-30 15:51:53+00:00)
Title: Bug 1018833 - Calendar sync duplicates events r=gaye

problem was caused because it was calling `ensureRecurrencesExpanded` on the caldav provider multiple times (once for each account) before it was able to update the `lastRecurrenceId`...

I'm still not sure if I changed the *best place* in the source code, it felt like the proper place was on the `IcalComponent#ensureRecurrencesExpanded` or on the `CaldavProvider#ensureRecurrencesExpanded`, but all the things that I could think seemed like the solution would be way more complex... - let me know if you think of a better solution on one of these methods. Basically we need to make sure it doesn't expand the same date twice while it is still *pending*.. (but we should allow it to expand again after it's complete)

the changes that I did to the unit test should catch regressions.