Mailspring/internal_packages/worker-sync/lib
Juan Tejada b1882656ee fix(deltas) Prevent app from crashing when processing deltas
Summary:
Some strange scenario is causing us to attempt to redefine the object property `_delta` on our `delta.attributes` object inside `DeltaProcessor._decorateDeltas`, which throws an error, and consequently throws the app into an error loop. I haven't been able to track down how to reproduce this, but when it happens it completely takes the app down.

From testing with tomasz's copy of N1, this seemed to have originated from the lack of Account tokens, which was hard to discover because the `_deltas` object completely floods the console with errors.

From what I gather, `_decorateDeltas` is only called from a single place, `DeltaProcessor.process`, which is also only called from a single place, and its unclear how it would be called multiple times with the same delta object references.

In order to prevent this error from completely destroying the app, I've added the `configurable` option when defining the property, so that redifining it doesn't throw an error. It should be safe to redefine this property with the latest delta reference, and will also allow us to discover other errors more easily in the console like the lack of account tokens which might be the original cause of this problem.

Test Plan: manual

Reviewers: mark, spang, evan, halla

Reviewed By: evan, halla

Differential Revision: https://phab.nylas.com/D3717
2017-01-16 19:37:37 -08:00
..
contact-rankings-cache.es6 refactor(nylas-api): Create API requests from tasks 2016-11-29 16:33:44 -08:00
delta-processor.es6 fix(deltas) Prevent app from crashing when processing deltas 2017-01-16 19:37:37 -08:00
delta-streaming-connection.es6 refactor(sync): sync workers only use delta syncs now 2016-12-02 14:48:56 -05:00
delta-streaming-in-memory-connection.es6 perf(delta): replaces API delta stream with direct in-memory one 2016-12-21 18:44:17 -08:00
main.coffee fix(sync): Support N1Cloud auth errors. Fix LongConnection cleanup 2016-12-01 12:04:37 -05:00
nylas-sync-worker-pool.es6 fix(sync-worker): Don't call _determineWorkerPool() twice 2016-12-22 12:43:45 -08:00
nylas-sync-worker.es6 fix(notifs) Restore offline notification 2017-01-11 17:26:27 -08:00
refreshing-json-cache.coffee feat(transactions): Explicit (and faster) database transactions 2015-12-17 11:46:05 -08:00