[buteo-sync-plugin-caldav] Fix upsync of imported exceptions. #20
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The sync code relies on the fact that added
exceptions on device inherit the URI and ETAG
of the parent, when the dissociation code is
called.
This assumption is not true when importing
an exception, like a cancel event received
by email for instance.
This commit ensures that such an imported
event is actually seen as a local addition
and that the ETAG used to push the event to
the server is using the ETAG of the parent.
@pvuorela, this is fixing the issue for me, where previously the lack of URI and ETAG in the imported exception was making the sync code to treat it as a non fully upsync event, not modified on device, and was thus scratched by downloading the server version to get the ETAG. URI and ETAG are custom properties saved by the sync plugin to get track of upsynced incidences.
This issue may impact other sync plugin, those relying on custom properties copied from the parent to the exception when created on device, I don't know. Another way of fixing the issue would be to modify the import code in nemo-qml-plugin-calendar in a way, that when importing an exception, the event is not added directly to the calendar, but follow the same route as created exceptions:
The problem is that this "merge" action does not exist in KCalendarCore API and is a bit ugly to add.
What's your opinion ?