Evernote 初始同步中的大 USN 值

Large USN value in Evernote initial sync

我正在尝试使用 Java 程序同步 evernote 帐户,下面是它的代码示例

NoteStoreClient noteStoreClient = clientFactory.createNoteStoreClient();
SyncChunk syncChunk = noteStoreClient.getSyncChunk(0, 200, true);

while (true) {
     List<Note> noteListforCurrentChunk = syncChunk.getNotes();
     //Sync to DB
     syncChunk = noteStoreClient.getSyncChunk(syncChunk.getChunkHighUSN(), 200, true);
     if (syncChunk.getChunkHighUSN() == syncChunk.getUpdateCount()) {
       return;
     }
}

我的用户第一次调用 syncChunk.getChunkHighUSN() returns 1187,结果没有检索到任何注释。这仅发生在某些帐户上

任何人都可以帮忙吗?

这是来自 the doc.

关于 USN 的一些引述

The USNs within an account start at “1” (for the first object created in the account) and then increase monotonically every time an object is created, modified, or deleted. The server keeps track of the “update count” for each account, which is identical to the highest USN that has been assigned.

因此,USN 数量多并不总是意味着您有很多笔记。只是表示用户对其账号进行了一些操作。

我必须创建一个过滤器才能使其正常工作。现在我可以找回这个笔记本下的所有笔记了

SyncChunkFilter filter = new SyncChunkFilter();
filter.setIncludeNotes(true);
NoteStoreClient noteStoreClient = clientFactory.createNoteStoreClient();
SyncChunk syncChunk = noteStoreClient.getFilteredSyncChunk(0, 200, filter);

while (true) {
     List<Note> noteListforCurrentChunk = syncChunk.getNotes();
     //Sync to DB
     syncChunk = noteStoreClient.getFilteredSyncChunk(syncChunk.getChunkHighUSN(), 200, filter);
     if (syncChunk.getChunkHighUSN() == syncChunk.getUpdateCount()) {
       return;
     }
}