Bug 86463

Summary: Implement a way to configure the initial date used for calendar sync
Product: SyncEvolution Reporter: renato filho <renatox>
Component: SyncEvolutionAssignee: renato filho <renatox>
Status: RESOLVED MOVED QA Contact:
Severity: enhancement    
Priority: medium CC: syncevolution-issues
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: implement startDate property to limit the initial calendar sync date.
remove unrelated changes
Use syncInterval property instead of startDate.
Path with the syncIterval property
full log of invalid sync
target full log
Path with the syncIterval property

Description renato filho 2014-11-19 14:12:24 UTC
Would be nice to have a way to limit the start date during a calendar sync. Ignoring very old events.
Comment 1 renato filho 2014-11-19 14:17:52 UTC
Created attachment 109731 [details] [review]
implement startDate property to limit the initial calendar sync date.
Comment 2 renato filho 2014-11-19 14:18:05 UTC
I have implemented a very simple way to configure the start date, that can be configure on the calendar source and is used by caldav source implementation.


Some points that still improvements:

1- Find a better name for the property name "startDate" is too generic;
2- The current configuration key "stateDate" appears for all kind of sources would be nice to make it available only for calendar sources (is that possible).

Check attachments with my patch.
Comment 3 renato filho 2014-11-19 14:21:35 UTC
Created attachment 109732 [details]
remove unrelated changes
Comment 4 Patrick Ohly 2014-11-20 15:28:48 UTC
Comment on attachment 109732 [details]
remove unrelated changes

Is the expectation that StartDate gets updated regularly by the user? When set only once, the calendar will start to grow over time again, it will just start smaller.

I'm not sure how significant that will be and in which cases - a slow sync perhaps.

The alternative would be to have a relative time and sync events falling into the last n days, for example. When a synchronized event falls out of that time range, it should (?) be removed locally. Not sure whether additional code is needed to achieve that. The same situation occurs when the user moves the startDate forward after having synchronized.

Another corner case is events created locally outside of the time range. I suppose they shall and will be synchronized to the server. When they then get edited on the server, is the change synced back?

The patch itself looks okay at first glance. "Leve it empty" is a type (should be "Leave"). A comment that this is only implement for CalDAV would be useful.

registry.push_back() and sourcePropCalendarStartDate don't line up with the rest of the surrounding code - were tabs used for formatting?
Comment 5 renato filho 2014-11-21 14:38:50 UTC
Created attachment 109799 [details]
Use  syncInterval  property instead of startDate.
Comment 6 Patrick Ohly 2014-11-25 11:28:57 UTC
Renato, can you investigate what happens in the corner cases that I mentioned?
Comment 7 Patrick Ohly 2015-04-01 13:56:15 UTC
Beware that the patches as they were proposed caused bug #89853.
Comment 8 renato filho 2015-04-01 15:13:47 UTC
Created attachment 114818 [details]
Path with the syncIterval property

Fixed a problem in the patch for sync interval starting on January.
Comment 9 renato filho 2015-04-07 02:28:49 UTC
Created attachment 114893 [details]
full log of invalid sync
Comment 10 renato filho 2015-04-07 02:29:38 UTC
Created attachment 114894 [details]
target full log
Comment 11 renato filho 2015-04-07 02:30:20 UTC
After this patch changing the syncInterval causes sync to update events that does not changed.
Comment 12 renato filho 2015-04-07 02:31:41 UTC
Created attachment 114895 [details] [review]
Path with the syncIterval property
Comment 13 renato filho 2015-04-07 17:08:14 UTC
As you can see on target log:

                             on Client   on Server
Added:                               0           2
Deleted:                             0           0
Updated:                             0           0
Rejected with error:                 0           0
Content Data Bytes sent:          1663
Content Data Bytes received:         0
Duration of sync [seconds]:          1

It says that 2 events was added on the server.
Comment 14 Patrick Ohly 2015-04-07 19:58:50 UTC
Renato sent me additional logs privately where after a slow sync with time filter set, a two-way sync removed events on the server. What happens is:
* slow sync Google: CalDAV filter returns a VCALENDAR item containing multiple VEVENTS, some of them inside, some outside the time range
* slow sync EDS: all of these events get stored in EDS
* slow sync EDS: change tracking records all events
* two-way sync EDS: EDS time range query only lists VEVENTs inside the range.
* two-way sync EDS: change tracking detects the missing events, treats them as "deleted" and...
* two-way sync Google: ... these out-dated events get deleted.

The right fix is to post-process the CaldDAV response and only consider VEVENTs which fall into the requested time range. This needs to be done inside the backend because the CalDAV server only filters per VCALENDAR, not per VEVENT,
and also does not simplify the content of a matching VCALENDAR.
Comment 15 Patrick Ohly 2015-04-17 08:47:50 UTC
Patch needs further work, see comment #14.

The investigation and/or documentation of corner case handling (= events falling out of the time range) is also still missing.
Comment 16 Patrick Ohly 2015-04-17 08:48:42 UTC
Comment on attachment 114893 [details]
full log of invalid sync

See comment #14.
Comment 17 Patrick Ohly 2015-04-17 08:49:00 UTC
Comment on attachment 114894 [details]
target full log

See comment #14.
Comment 18 Patrick Ohly 2015-04-17 08:49:48 UTC
Comment on attachment 114895 [details] [review]
Path with the syncIterval property

Does not include post-processing of the CalDAV server response, leading to the issue described in comment #14.
Comment 19 GitLab Migration User 2018-10-13 12:40:18 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/SyncEvolution/syncevolution/issues/41.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.