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 