From 63343adeac7ae1efa52e917fa7425a110d9e771e Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Mon, 11 Apr 2016 17:33:56 -0700 Subject: [PATCH] =?UTF-8?q?fix(sync):=20Handle=20"Invalid=20cursor"=20scen?= =?UTF-8?q?ario=20by=20=F0=9F=92=A3=F0=9F=94=A5=20away=20the=20cache?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../worker-sync/lib/nylas-long-connection.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal_packages/worker-sync/lib/nylas-long-connection.coffee b/internal_packages/worker-sync/lib/nylas-long-connection.coffee index 338ff52a9..63cb49f11 100644 --- a/internal_packages/worker-sync/lib/nylas-long-connection.coffee +++ b/internal_packages/worker-sync/lib/nylas-long-connection.coffee @@ -1,4 +1,5 @@ {Emitter} = require 'event-kit' +{DatabaseStore} = require 'nylas-exports' url = require 'url' _ = require 'underscore' @@ -109,10 +110,9 @@ class NylasLongConnection if res.statusCode isnt 200 res.on 'data', (chunk) => if chunk.toString().indexOf('Invalid cursor') > 0 - console.log('Delta Connection: Cursor is invalid. Need to blow away local cache.') - # TODO THIS! - else - @close() + error = new Error('Delta Connection: Cursor is invalid. Need to blow away local cache.') + DatabaseStore._handleSetupError(error) + @close() return @_buffer = ''