问题
In the documentation for Google Calendar API, it says this:
Sometimes sync tokens are invalidated by the server, for various reasons including token expiration or changes in related ACLs. In such cases, the server will respond to an incremental request with a response code 410. This should trigger a full wipe of the client’s store and a new full sync.
A lot of sync tokens in my system are being invalidated, and I don't know why. I am getting this error for a lot of calendars:
(410) Sync token is no longer valid, a full sync is required.
What can I do to prevent this from happening or to re-validate a sync token without forcing the user to log in and reconnect to his calendar. It is very inconvenient at the moment.
回答1:
Correct handling has nothing to do with re-logging etc. The deal is that this sync token can no longer give you a correct diff between what you have stored locally and what is on the server. Therefore it's recommended that you clear the events in your local store and send a full sync request (that means a list request with no sync token). You can keep using the same authentication token.
来源:https://stackoverflow.com/questions/33159301/what-to-do-when-google-calendar-api-sync-token-is-invalid