SyncStateNotFound 错误:如何修复或避免? [英] SyncStateNotFound error: how to fix or avoid?

查看:13
本文介绍了SyncStateNotFound 错误:如何修复或避免?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I am using Microsoft Graph API delta queries for downloading some information (messages, contacts, events) regularly. But sometimes I get this error:

{
    "error" :
    {
        "code" : "SyncStateNotFound",
        "innerError" :
        {
            "date" : "2018-06-01T06:31:24",
            "request-id" : "47e918a9-ce5b-42b4-8a86-12b96c93121a"
        },
        "message" : "The sync state generation is not found; generation=605;[highest=841][841][839][840]."
    }
}

I can't provide you steps for reproducing because I don't know how to reproduce it. It happens sometimes on production environment.

So I have some questions:

  1. What is generation in Microsoft Graph API? Is there any available documentation about it? I didn't find anything useful in the Internet.
  2. Why delta links expire? Delta link expires by time or some iterations of using delta links? Can I save my delta link in my database and in a e.g. 1 year use this delta link for syncing again?
  3. How to avoid delta links expiration? Are there any lifehacks?
  4. What should I do if I got this issue? Full resync and getting new delta link?
  5. Is it a bug or feature?

解决方案

Every time you sync, a new sync token is generated. We store the current sync token along with the two previous ones. This helps us in cases where we advance the sync on the server side, but something happens transmitting the data to the client so they don't get the new token value. In such cases, we can "fallback" to the previous sync token so that the client doesn't have to resync everything. But these three stored tokens change with each sync - the oldest one gets dropped and we advance. In your case, you are passing us a delta token that is around 230 generations old. That token is long gone.

Another thing to consider is that an "inactive" sync token will hang around for around 90 days at which point we consider it stale, pour gas on it and set it on fire (not really).

这篇关于SyncStateNotFound 错误:如何修复或避免?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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