pouchdb 已停止同步且没有错误

pouchdb has stopped syncing with no errors

我正在使用这个曾经有效的同步代码,但现在无法正常同步。

this.sync = function(remoteDatabase) {
            database.sync(remoteDatabase, {live: true, retry: true})
                .on('complete', function (changes) {
                  // yay, we're in sync!
                    console.log("sync complete");
                }).on('change', function (change) {
                    // yo, something changed!
                    console.log("sync change");
                }).on('paused', function (info) {
                  // replication was paused, usually because of a lost connection
                    console.log("sync pause");
                }).on('active', function (info) {
                  // replication was resumed
                    console.log("sync active");
                }).on('error', function (err) {
                  // boo, we hit an error!
                    console.log("sync error");
                  alert("data was not replicated to server, error - " + err);
            });
            console.log("end of sync function");
        };

我的开发控制台显示:

        end of sync Function

大约 10 秒后,控制台显示:

        sync paused
        sync paused

控制台中没有错误,包括没有同步指示。

我的 google 搜索没有找到类似的东西。

任何想法都会很棒。

我发现了我的问题。 我在玩离线功能,没有清除缓存。缓存中有 upup.sw.min.js 个文件似乎把所有东西都搞砸了。清除该地址的缓存后,我的同步工作正常。

感谢迈克推动我看得更远。