💌 A beautiful, fast and fully open source mail client for Mac, Windows and Linux.
Go to file
Juan Tejada b79488ae43 [local-sync, cloud-api, cloud-workers] Fix msg id collision, tracking and sending issues, some refactoring
Summary:
This diff solves a few separate issues from T7313, T7316, T7282, and it refactors
the send code a little bit.

Initially, the problem that led to this diff was generating message ids that
wouldn't collide (which was causing errors in the message-processor). Collisions
in ids were being caused by messages that contained the exact same participants,
subject and date (most likely due bots or scripts sending emails in quick
succession)

To prevent collisions this commit adds the `message-id` header as part of the
database message id, and ensures that we set it correctly before sending, and
that it remains consistent through send, multi-send, and the sync loop.

During the refactor and review, I removed some code that assumed that we were
syncing drafts (which we aren't), and also fixes a few other known and
unknown issues around sending, message creation, and tracking, like assigning
the correct date header (we were previously assigning the draft creation date
from within N1), fixing the tracking regex, among other smaller bugs/typos.

Will address inline TODOs in a separate diff

Test Plan: TODO!!! I will add tests in another diff

Reviewers: evan, halla, jackie, khamidou

Reviewed By: halla, jackie

Differential Revision: https://phab.nylas.com/D3507
2016-12-14 19:35:48 -08:00
arclib [local-private] move old edgehill src/pro into packages/local-private 2016-12-12 10:09:58 -05:00
packages [local-sync, cloud-api, cloud-workers] Fix msg id collision, tracking and sending issues, some refactoring 2016-12-14 19:35:48 -08:00
.arcconfig [local-private] move old edgehill src/pro into packages/local-private 2016-12-12 10:09:58 -05:00
.arclint [local-private] move old edgehill src/pro into packages/local-private 2016-12-12 10:09:58 -05:00
.dockerignore Dockerfile successfully building ping endpoint 2016-07-07 12:10:01 -07:00
.eslintrc Fix linter issues 2016-11-21 14:00:35 -08:00
.gitignore [local-sync, cloud-api, cloud-workers] Fix msg id collision, tracking and sending issues, some refactoring 2016-12-14 19:35:48 -08:00
.tern-project Enable nodejs completion with tern 2016-12-07 07:25:48 -08:00
Dockerfile [cloud] fix(eb): Oops 2016-11-22 13:25:58 -08:00
lerna.json [*] update lerna to 2.0.0-beta.30 2016-12-06 16:03:31 -08:00
package.json [*] update lerna to 2.0.0-beta.30 2016-12-06 16:03:31 -08:00
pm2-dev.yml [cloud-api] New honeycomb ingestion endpoint 2016-12-01 11:21:28 -08:00
pm2-prod-api.yml [cloud] fix(eb): Oops 2016-11-22 13:25:58 -08:00
pm2-prod-workers.yml Pull in cloud packages 2016-11-22 10:58:27 -08:00
README.md Readme updates 2016-11-28 14:13:23 -08:00
test_accounts.txt First step to getting persistent id in K2 2016-12-01 11:15:13 -08:00

K2 - Local Sync Engine & Cloud Services for Nylas N1

This is a collection of all sync and cloud components required to run N1.

  1. Cloud API: The cloud-based auth and metadata APIs for N1
  2. Cloud Core: Shared code used in all remote cloud services
  3. Cloud Workers: Cloud workers for services like send later
  4. Isomorphic Core: Shared code across local client and cloud servers
  5. Local Sync: The local mailsync engine integreated in Nylas N1

See /packages for the separate pieces. Each folder in /packages is designed to be its own stand-alone repositoriy. They are all bundled here for the ease of source control management.

Initial Setup for All Local & Cloud Services:

New Computer (Mac):

  1. Install Homebrew
  2. Install NVM brew install nvm
  3. Install Node 6 via NVM: nvm install 6
  4. Install Redis locally brew install redis

New Computer (Linux - Debian/Ubuntu):

  1. Install Node 6+ via NodeSource (trusted):
  2. curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
  3. sudo apt-get install -y nodejs
  4. Install Redis locally sudo apt-get install -y redis-server redis-tools benefit of letting us use subdomains.