onPerformSync(...) checks to see if you are already performing a sync of the requested account and authority. If so, you return without doing anything. The problem with this is that another process may be making many modifications to the calendar, and the sync will start on the first modification. So some modifications may occur after the affected events have already been synced. In that case the modifications will not get uploaded to the server until the next time DAVx5 does a sync. This isn’t disastrous, since the upload will eventually occur, but it isn’t what you say you do.
I think that the correct logic is to maintain for each
Pair(authority, account) a flag which is initially false and set to true if another sync request has arrived during the sync. If in the
finally clause you find that the flag is set, you clear it and do another sync instead of doing the
I would offer a patch if it was Java code, but I’m not familiar enough with Kotlin to write code in it.
Seen with DAVx5 Version 2.1-ose built 1 Jan 2019