Events are being duplicated



  • @rfc2822 My device is Samsung S2 (i9100). I confirm that I haven’t switched the server.



  • Guys, I honestly think that leads in the wrong direction because I did switch servers (from nextcloud to Apple icloud).
    I’ve had the same issue with both servers.

    To me, the most logical explanation would be that the bug is in the communication between davdroid and calendar storage.
    Something like davdroid asking „Is there an event with the following properties?“ and calendar storage getting the lookup wrong answering „No, I don’t have an event like this. I’ll just create a new one“.

    I provided all the properties of a duplicate events yesterday. I would suspect that there’s some problematic property that causes the lookup (you’re probably doing an SQL select, aren’t you?) to fail…

    Gruß Tobias



  • I just checked the state of the mobile phone of my wife which is using the same calendar as I do concerning the birthdays and - SURPRISE - she’s not affected at all, neither a duplicated nor a triple entry, like I described in the .ics examples above.

    We are using both:

    • Android 7.0
    • DavDroid 1.7.2
    • same history (using S-Planner until DavDroid 1.7)

    The difference is:

    • She have a Samsung Galaxy S6
    • I have a Samsung Galaxy S7 Edge (with external storage if that does matter?)
      and I’m 99% sure that I was not affected in the past when I used a Samsung Galaxy S6 Edge.

    Regards,
    Harald



  • Hi @rfc2822,

    finally I’ve got the logs for a duplicate event. It took a while for one to show up after I turned on debugging.

    What I did was:

    1. download all the log from my mobile to my computer.
    2. grep for which log files contain the event id (just one file)
    3. read that log file and delete all the lines that have to do with other calendars (the duplicate event is in calendar #5).
    4. delete lines to do with other events
    5. delete lines to do with net.fortuna.ical4j.model.Recur (too many).

    This leaves
    0_1504821641078_log.txt

    From what I understood, the event is first uploaded to iCloud and then after a minute or so, downloaded as changed again.

    I hope you can really fix the problem now. It’s totally annoying.

    LG Tobias

    PS: The two events again only differ in modified_time and _id:

    0_1504822118093_Duplicate-Event.pdf


  • developer

    @benjamin-kwiatek Thanks for the logs. What I can see:

    1. DAVdroid finds a new event and assigns file name and UID dd100933-7e4e-4b08-bd65-e36b9e3e2161.ics.
    2. DAVdroid uploads dd100933-7e4e-4b08-bd65-e36b9e3e2161.ics. The server accepts the file (201 Created), but does not return an ETag – which is OK, but implies that DAVdroid will have to download the event again in order to get a well-defined state with ETag. This is usual for various servers, well-tested and shouldn’t cause any problems.
    3. DAVdroid requests the list of events, and finds dd100933-7e4e-4b08-bd65-e36b9e3e2161.ics has ETag "C=2994@U=7c3254a4-7d84-4430-ad67-1eaa094b814c" on the server, so it will be downloaded.
    4. DAVdroid downloads dd100933-7e4e-4b08-bd65-e36b9e3e2161.ics, parses it and updates it in the database:
    2017-08-27 12:54:30 2 [syncadapter.CalendarSyncManager] Updating dd100933-7e4e-4b08-bd65-e36b9e3e2161.ics in local calendar
    2017-08-27 12:54:30 2 [ical4android.AndroidEvent] Built event object
    	PARAMETER #0 = mType: 1, mUri: content://com.android.calendar/events?account_name=meine.adresse%40gmail.com&account_type=bitfire.at.davdroid&caller_is_syncadapter=true&account_name=meine.adresse%40gmail.com&account_type=bitfire.at.davdroid&caller_is_syncadapter=true, mSelection: null, mExpectedCount: null, mYieldAllowed: false, mValues: eventTimezone=Europe/Berlin title=XXX availability=0 eventStatus=1 dtend=1504386000000 hasAttendeeData=1 allDay=0 dtstart=1504375200000 calendar_id=5 eventEndTimezone=Europe/Berlin, mValuesBackReferences: null, mSelectionArgsBackReferences: null
    2017-08-27 12:54:30 2 [ical4android.BatchOperation] Committing 3 operations …
    2017-08-27 12:54:30 2 [ical4android.BatchOperation] Running operations 0 to 2
    2017-08-27 12:54:30 2 [ical4android.BatchOperation] … 2 record(s) affected
    

    The update process consists of deleting the previous event, deleting the exceptions (in this case: none), and then inserting the event again. So these are 3 operations (delete, delete, insert) with 2 affected rows (original event, new event).

    The inserted event is OK, doesn’t cause any errors and is only inserted once.

    I really can’t see any problem …



  • Hi, I’m experiencing similar issue but only in one calendar and the number of duplicates is constantly raising, currently I’ve got events that has up to 5 clones.
    This one particular calendar is quite often updated on the (OwnCloud) server.
    I’m using Android 7.1.2 but my SO also sees all duplicates in this calendar on her much older android.

    What can I do to help? I’ve got rooted phone.



  • @b3niup try to clear the calendar storage, reboot your phone, force a sync in davdroid! make sure you have a backup when performing such operations. maybe it helps 🙂



  • @devvv4ever I did that, helped for a few days and it started again :<

    edit: by asking ‘what can I do to help’ i meant actually providing some info about the issue to help you figure it out 😉


  • developer

    @b3niup Unfortunately, I don’t know what to do as long as I can’t reproduce the problem. If anybody has an idea, let us know…



  • @rfc2822 I guess in my case it’d be sufficient to add my calendar to davdroid and wait a few days.
    I’ll try to prepare an access to it for you today and PM you the details if that’s ok with you.


  • developer

    @b3niup Yes, but on my device the problem will most probably not be reproducible. We can of course try again …



  • I don’t know if it helps, but I also experience the same issue and made some “experiments” with various calendar apps on Android and on my PC (on Linux).

    What I discovered is that, in my case, every recurrent event having one or more deleted or modified instances is always duplicated on every Android Calendar apps I tested whereas recurrent events without specific modifications aren’t. I never observed this behavior on any desktop app which also leads me to the conclusion that the problem must be between DAVdroid and Android Calendar Storage.
    (note that the modifications/suppressions of instances of recurring events were only made on desktop apps, simply because the option didn’t seem to be supported on any Android app I tried)

    Android tested apps: Stock Calendar app, Etar, Business Calender, Google Calendar,
    Desktop apps: Thunderbird (Lightning), Gnome Calendar and nextcloud web GUI .
    Phone model: Honor 4X (Che2-l11)
    Android version: 6 marshmallow (Emui 4.0.3)
    Server-side: Nextcloud 12
    Dav-droid version : 1.8.1-ose

    I hope this helps a bit to understand the issue.



  • Hm, I’ve tried that and failed to reproduce that on my setup with this scenario, even though I am affected by duplication for some events (all the duplicate events in my case are recurrent events though, afaict).



  • Well, actually things have changed since my last message. Now things are even worse, some recurrent events have been duplicated more than 50 times (not even visible anymore on my calendar since there are too much events at the same time) and even some non-recurrent events are now duplicated (only twice this time). This is very annoying and makes it impossible to manage my calendar correctly unfortunately.
    I think my only option is to go back to Google Calendar for a little while till this bug is fixed. Developers, you have all my sympathy 😉
    (just in case this kind of info is useful, my timezone is Brussels GTM+02, you never know …)


Log in to reply