forked from nylas/nylas-mail
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[client-app] (deltas P6) Split local and cloud deltas
Summary: This commit splits apart the `AccountDeltaConnection` class, which was in charge of listening to both cloud /and/ local deltas by way of an artificial interface, `DeltaStreamingInMemoryConnection`. Splitting this into 2 modules with separate responsibilities will hopefully make this code easier to reason about and reduce some cruft and unnecessary indirection. Specifically, this commit makes it so: - `DeltaConnectionManager` is only in charge of starting and ending `DeltaStreamingConnection`s, which are solely in charge of listening to deltas from the cloud api - `LocalSyncDeltaEmitter` no longer unnecessarily emits events for the `deltas` package to listen to but rather directly processes and saves those deltas from the K2 db to edgehill.db - `LocalSyncDeltaEmitter` is also in charge of keeping track of the latest received cursor, under its own JSONBlob key in edgehill.db. This migrates localSync cursors saved under the old key. - `LocalSyncDeltaEmitter` is now instantiated and managed from within the `SyncProcessManager` as opposed to the `SyncWorker`. Apart from removing extra state from the `SyncWorker`, this removes dependencies on the client-app environment from the sync-worker. - `DeltaStreamingInMemoryConnection` and `AccountDeltaConnection` are now gone (Sorry for the big diff! This one was a little hard to split up without landing something broken) Depends on D4121 Test Plan: manual + unit tests planned in upcoming diff Reviewers: halla, mark, evan, spang Reviewed By: evan Differential Revision: https://phab.nylas.com/D4122
- Loading branch information
Showing
8 changed files
with
141 additions
and
281 deletions.
There are no files selected for viewing
142 changes: 0 additions & 142 deletions
142
packages/client-app/internal_packages/deltas/lib/account-delta-connection.es6
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 0 additions & 52 deletions
52
packages/client-app/internal_packages/deltas/lib/delta-streaming-in-memory-connection.es6
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.