Server/Client conflict when importing .ics file into client ?



  • I am switching between various CalDAV servers to test them out. (Owncloud, Baikal, Synology NAS).
    I am trying to transfer my entire calendar between servers, I don't want to do every entry by hand, so I use the .ics import/export feature in my android calendar client : SolCalendar
    I believe the application imports all the events correctly, but as soon as it syncs to the server, the imported calendar is returned to it's previous state (it removes all the imported events).

    I believe it may be a client/server conflict in which davdroid prefers the server's calendar.
    Is there a way to modify the way davdroid solves this conflict by temporarely choosing the client's calendar ?

    Servers :
    transferring from Owncloud 5.0.13 to Baikal 0.2.6
    .ics file :
    I tried exporting from SolCalendar 1.0.8 client and from Owncloud web interface
    importing into SolCalendar 1.0.8
    Android : Cyanogenmod 11.2013.12.09 nightly i9300

    Maybe you could suggest an other android app with the .ics import feature I could try (free) to see if it's a davdroid issue or SolCalendar issue.


  • developer

    Please give detailed steps to reproduce. I don't get why you need SolCalendar. You can import/export the contacts from the default contacts app. I recommend to 1) export your contacts via the default Contacts app, 2) manually check the resulting .vcf and remove unnecessary lines, 3) import the contacts via the default Contacts app into the DAVdroid account.



  • It's a calendar only issue. I haven't had this issue with contacts.

    I don't think the default Android calendar is able to import/export calendars to and from .ics file (I haven't found any feature like that, which is why I use Solcalendar)
    I just export everything from my source calendar (the one hosted on my owncloud server I've been using for a few months with lots of events),
    I create a new empty calendar for my user on the server side using the Baikal admin web page, add it to the phone using davdroid, and then import the .ics file into the empty calendar using the calendar app (SolCalendar).
    As long as Davdroid doesn't synchronises, all the events appear to be imported into the new calendar, however when it syncs, all the events I imported are instantly wiped off.

    I tried to add one or two events manually and they work as usual. And if I then import again and sync, only the manually added events remain. Which is why I believe davdroid doesn't understand what the imported events are and just restores the server's version of the calendar (which doesn't have any of the imported events)


  • developer

    Which DAVdroid version did you use? Until 0.5.3, DAVdroid had issues when a larger number of events was synchronised. Can you please try again with the latest version and also provide logs?



  • @BlackSharkfr You can use desktop software like IceDove or IceOwl or Thunderbird to import ics files to CalDav servers. Many people do this, and we know it works well. If it were me, I would avoid SolCalendar, because if it has problems they will be hard to spot.

    I think a good order of things is to: (1) install your CalDav server, (2) connect to it with a desktop client and upload your ics data using that desktop client, (3) play around with that until you are sure it's working, and then finally (4) sync DAVdroid to it.


  • developer

    Is this issue still present? Otherwise, I'll close it.



  • I just tried again.
    I still have the issue. I am using davdroid 0.5.6.alpha from the F-Droid
    repository.
    Since you said you corrected the bug, I believe the calendar application
    (solcalendar) is probably not importing the .ics file properly.

    I could do the transfer in a desktop app like recommended before, but I'd
    rather try an android app in order to make sure the update goes through
    davdroid.
    Which calendar app do you use ?
    Le 25 janv. 2014 16:11, "rfc2822" notifications@github.com a écrit :

    Is this issue still present? Otherwise, I'll close it.


    Reply to this email directly or view it on GitHubhttps://github.com/rfc2822/davdroid/issues/116#issuecomment-33290966
    .


  • developer

    Since you said you corrected the bug, I believe the calendar application
    (solcalendar) is probably not importing the .ics file properly.

    Quite possible.

    I could do the transfer in a desktop app like recommended before, but I'd
    rather try an android app in order to make sure the update goes through
    davdroid.

    It would be best if you transfer the events to a CalDAV server first and then just sync the calendar with DAVdroid.

    Which calendar app do you use ?

    I juse the default Android calendar app.



  • "I believe the application imports all the events correctly, but as soon as it syncs to the server, the imported calendar is returned to it's previous state (it removes all the imported events)."

    It sounds to me like...

    Calendar00 is present in the remote collection.
    Calendar00 is present in the local collection.
    Calendar00 in local collection is different than Calendar00 in the remote collection.

    The behavior you're experiencing makes sense if the CTag of Calendar00-local is different than the CTag of Calendar00-remote, or if Calendar00-local does not have an associated CTag. In WebDAV "the server always wins", I think your import work flow just needs to be tweaked.


  • developer

    The behavior you're experiencing makes sense if the CTag of Calendar00-local is different than the CTag of Calendar00-remote, or if Calendar00-local does not have an associated CTag. In WebDAV "the server always wins", I think your import work flow just needs to be tweaked.

    Local calendars don't have a CTag, there are just "last remote CTags". Local changes are recorded by marking records dirty; these dirty records are then PUTted/DELETEd to the server (with appropriate If-[None-]Match headers). So I think this is not an explanation. :/



  • You're right, and I think this is outside the scope of collection CTags.

    "I create a new empty calendar for my user on the server side using the Baikal admin web page, add it to the phone using davdroid, and then import the .ics file into the empty calendar using the calendar app (SolCalendar). As long as Davdroid doesn't synchronises, all the events appear to be imported into the new calendar, however when it syncs, all the events I imported are instantly wiped off."

    In this case I would expect that SolCalendar imports the .ics into the ContentProvider without populating the "Calendars.CAL_SYNC1" or "Events._SYNC_ID" fields. Then when davdroid gets an onPerformSync#, SyncManager.pushNew# is run and LocalCollection.findNew# returns the imported events because the records are "dirty" and have a null remote name field (Events._SYNC_ID in this case). The imported events would all be PUT to the new remote collection successfully because the remote collection is empty.

    If somehow the PUT to the new remote collection failed without notice or exception, all of the imported events would be deleted locally at the end of SyncManager.synchronize# with the call to LocalCalendar.deleteAllExceptRemoteNames#. If we accept that the remote collection is not empty the failed PUTs make sense but the local collection would contain something after sync. If we accept that the remote collection is empty the empty-post-sync state makes sense if the PUTs somehow failed without notice.

    Because all imported events disappear after sync I think it is safe to assume that SolCalendar imported the events at least correctly enough for davdroid to delete them. However the hypothetical failed PUTs could be the fault of a bad import, still unsure how the failure could go unnoticed.

    If @BlackSharkfr could provide server logs I think that might be enough to figure this out but of course LogCat is always excellent :D


  • developer

    @rhodey Sounds like a good explanation, but when the PUT fails, a HttpException would be thrown and the sync process would be aborted with notifying Android (which would show the red alert icon with "Sync is currently experiencing problems").

    So I'll close because I can't reproduce it and don't know if this is a bug. If you still have this problem and can provide logs, please comment here and I'll re-open.



  • I've decided to let go and stick with my current owncloud server for now. I
    uninstalled baikal.
    I probably won't try a different caldav server for a few months, and i'll
    do it with thunderbird as suggested.
    Thank you anyway for helping.
    Le 26 févr. 2014 21:28, "rfc2822" notifications@github.com a écrit :

    @rhodey https://github.com/rhodey Sounds like a good explanation, but
    when the PUT fails, a HttpException would be thrown and the sync process
    would be aborted with notifying Android (which would show the red alert
    icon with "Sync is currently experiencing problems").

    So I'll close because I can't reproduce it and don't know if this is a
    bug. If you still have this problem and can provide logs, please comment
    here and I'll re-open.

    --
    Reply to this email directly or view it on GitHubhttps://github.com/rfc2822/davdroid/issues/116#issuecomment-36172621
    .


Log in to reply
 

Looks like your connection to Bitfire App Forums was lost, please wait while we try to reconnect.