Skip to content
Commit e999f481 authored by Igor Poboiko's avatar Igor Poboiko
Browse files

[calendar] Implement SyncToken for Calendar service

Summary:
This is an implementation of a `syncToken` Google API feature (see {T8376}, and
https://developers.google.com/calendar/v3/reference/events/list) which is a
native way to perform incremental updates.

When `EventFetchJob` is created, we can provide it with a token by calling
`job->setSyncToken(token)`, which will be used as a parameter for fetching.
Note: some of the parameters are incompatible with `syncToken` (`timeMin`,
`timeMax`, `updatedMin`, see API link above), so if token is provided, those
parameters get ignored.

When the job is finished, the next sync token can be obtained via
`job->syncToken()`. This token then can be used for the next `EventFetchJob`.

Test Plan:
1. Create an `EventFetchJob` with no `syncToken`
2. When job is finished, fetch its `syncToken`
3. Create a new job, using previous `syncToken`
4. Only incremental changes are obtained

Reviewers: dvratil

Subscribers: kde-pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D28162
parent 7f7d461d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment