fix(cursor): Remove stale cursor from config.cson when cursor error

- #2049
This commit is contained in:
Juan Tejada 2016-04-28 10:14:26 -07:00
parent fbd77fb5f6
commit 04cebd51f2

View file

@ -111,6 +111,7 @@ class NylasLongConnection
res.on 'data', (chunk) =>
if chunk.toString().indexOf('Invalid cursor') > 0
error = new Error('Delta Connection: Cursor is invalid. Need to blow away local cache.')
NylasEnv.config.removeAtKeyPath("nylas.#{@_account.id}.cursor")
DatabaseStore._handleSetupError(error)
@close()
return