Google Calendar API同步令牌无效时该怎么办? [英] What to do when Google Calendar API sync token is invalid?

查看:111
本文介绍了Google Calendar API同步令牌无效时该怎么办?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Google Calendar API的文档中,内容如下:

In the documentation for Google Calendar API, it says this:

有时,由于各种原因(包括令牌到期或相关ACL的更改),服务器使同步令牌无效.在这种情况下,服务器将使用响应代码410响应增量请求.这将触发对客户商店的完全擦除和新的完全同步.

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)同步令牌不再有效,需要完全同步.

(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.

推荐答案

正确的处理与重新记录等无关.要做的是,此同步令牌无法再为您提供本地存储之间的正确区别以及服务器上的内容.因此,建议您清除本地存储中的事件并发送完整的同步请求(这意味着没有同步令牌的列表请求).您可以继续使用相同的身份验证令牌.

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.

这篇关于Google Calendar API同步令牌无效时该怎么办?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆