(#126 is a similar issue, but related to calendars, instead of address books. However, it seems that address books do not seem to have a read-only flag in Android, so this needs to be solved differently.)
When adding an address book, DAVdroid can identify whether it is read-only or read-write. However, it seems to be unable to make this clear to Android (it seems there is no support for a read-only flag there).
Changing contacts from this read-only address book results in the problem described in #126: DAVdroid tries to write the changes back and fails with HTTP 403. This is repeated at every sync attempt, resulting every time in an error message the user can do nothing about.
It also seems that the (automatic or manual) merging of contacts changes them, probably setting some relationship attributes. So having related contacts in read-only address books seems to be an automatic cause for persistent sync errors.
My suggestion to fix this is as follows.
- Try to convey the read-only flag to Android (this is probably not possible; in this case: skip this).
- When a 403 occurs when writing to a read-only address book, handle it as follows.
- Display the error message, with a clear description of what has caused this and what this means.
- Set a flag, causing further writes to the address book to fail silently.
- Display this flag in the sync options for this address book to remind the user.
I do not yet know what is the best way to deal with the changed contacts. I would suggest just to revert them back to the server version on sync. However, if there is some automatically updated linking information, that would need to be preserved in order to avoid an endless syncing loop.