Commit graph

19 commits

Author SHA1 Message Date
Juan Tejada 87acb233b7 [client-app] Fix missing depedency for imap-provider-settings 2017-03-14 10:42:30 -07:00
Karim Hamidou b1ba489065 Revert "Revert "[feat] Add support for send later""
Arc land messed up and landed a not fully merged branch. (Seriously – I
had merged a copy of my branch with master to see how easy it would be.
Because I didn't want to merge the whole thing, I blindly committed my
changes and switched back to my real branch). To my great surprise, arc
decided to use the wrong branch when landing it.

Original commit message:

Summary:
    Finally, here it is! Send later, with support for open tracking but
without support for attachments yet. It took me some time to find the
right way to do things.

    **The send later dilemna**

    There's two ways we could handle send later:
    1. do everything on the client
    2. process the message in the cloud

    1. is very tempting because it would make the cloud server very
simple. Unfortunately, it has some serious limitations, for example,
setting the "Date" message header. That's why I chose to go with 2. When
a user presses the "Send Later" button, we save the open/link tracking
metadata and fills in all the required fields. I added a custom endpoint
to the K2 API to do this, `/drafts/build`. After that, we save the JSON
contents of the message as metadata.

    When we process metadata, we simply create a MIME message from the
JSON and send it.

    **Limitations**

    Right now, send later doesn't support and attachments. There's also
some minor code duplication which needs to be refactored away.

Test Plan: Tested manually. Checked that regular send still worked, too.

Reviewers: mark, spang, halla, juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D4054
2017-03-07 17:21:29 -08:00
Karim Hamidou 2f67d8ac8b Revert "[feat] Add support for send later"
This reverts commit 683a550d49.
2017-03-07 16:18:25 -08:00
Karim Hamidou 683a550d49 [feat] Add support for send later
Summary:
Finally, here it is! Send later, with support for open tracking but without support for attachments yet. It took me some time to find the right way to do things.

**The send later dilemna**

There's two ways we could handle send later:
1. do everything on the client
2. process the message in the cloud

1. is very tempting because it would make the cloud server very simple. Unfortunately, it has some serious limitations, for example, setting the "Date" message header. That's why I chose to go with 2. When a user presses the "Send Later" button, we save the open/link tracking metadata and fills in all the required fields. I added a custom endpoint to the K2 API to do this, `/drafts/build`. After that, we save the JSON contents of the message as metadata.

When we process metadata, we simply create a MIME message from the JSON and send it.

**Limitations**

Right now, send later doesn't support and attachments. There's also some minor code duplication which needs to be refactored away.

Test Plan: Tested manually. Checked that regular send still worked, too.

Reviewers: mark, spang, halla, juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D4054
2017-03-07 16:06:30 -08:00
Juan Tejada 6557618cb4 [iso-core] 🎨 Rename imap-pool.es6 to imap-connection-pool
To be consistent with the name of the exported module
2017-03-02 14:45:34 -08:00
Halla Moore 82e7a276a3 [*] Move Jasmine setup into isomorphic-core
Summary:
Move the base Jasmine spec runner into isomorphic-core to prevent
code duplication. Jasmine will look for the config file relative to
the directory it's being run in though, so we need to symlink the
config file into each package that will need it.

Test Plan: Run tests once the suites are integrated

Reviewers: evan, spang, juan

Reviewed By: spang, juan

Differential Revision: https://phab.nylas.com/D4056
2017-03-01 11:08:37 -08:00
Mark Hahnenberg c634380ab6 [client-sync] Add per-Account IMAP connection pooling
Summary:
Prior to this diff it was easy for us to create too many IMAP connections (e.g.
by requesting many attachments at once), causing random failures when the
server would reject our connection attempts. This diff adds a per-Account IMAP
pooling mechanism so that we avoid these failures.

Test Plan:
Run locally with sync worker and several other clients using the
pool, verify correct behavior. Also added a few unit tests.

Reviewers: evan, spang, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3965
2017-02-21 14:00:08 -08:00
Juan Tejada 301766722a [local-sync] metrics(Part 2) Move MetricsReporter to isomorphic-core
Summary:
Renamed it from SyncMetricsReporter to MetricsReporter and moved it to
iso-core.

The new metrics reporter can now be called from any environment and will
correctly report the metrics.

Test Plan: manual

Reviewers: mark, spang, evan

Reviewed By: spang, evan

Differential Revision: https://phab.nylas.com/D3967
2017-02-21 11:44:21 -08:00
Mark Hahnenberg 8267a14966 [iso-core] Add BackoffScheduler to exports
Summary: See title

Test Plan: Make sure NM loads

Reviewers: evan, spang, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3959
2017-02-17 11:03:26 -08:00
Juan Tejada e17b6d8d17 [local-sync]: Move sendmail-client and errors to isomorphic-core
Summary:
Move sendmail-client and errors to isomorphic-core, given that they will
probably be used by cloud-workers (plugin backends) and cloud-api

Depends on D3510

Test Plan: Manual

Reviewers: halla

Reviewed By: halla

Differential Revision: https://phab.nylas.com/D3512
2016-12-15 12:29:56 -08:00
Evan Morikawa 896f981408 [isomorphic-core] extract AuthHelpers to DRY 2016-12-06 16:03:31 -08:00
Ben Gotow 7712269402 [*] fix(deltas): Cloud-API not filtering deltas at all, refactor a few things
- Don’t need functions in delta.js which must be called to return promsies. Fun of promsies is that you don’t need to care when they’re built to attach a .then.

- Make boundary between route handler and delta stream builder more explicit, don’t do query parsing in helpers, always reply from handler.

- Remove pushJSON extension to outputStream which never actually received JSON.

- Remove `takeUntil` - disposing of the downstream observable should dispose of all the merged/upstream observables

- Rename inflate => stringify since the returned value is a string not an object.

- Remove support for delta streams with no cursors. Don’t think this was supposed to be a feature.

- Add accountId to Transaction models

- Make database hooks shared in isomorphic core
2016-12-01 18:41:46 -08:00
Ben Gotow 4b4ab726e2 [💄] fix eslint issues before they get overwhelming 2016-12-01 15:37:48 -08:00
Evan Morikawa a36b1e1f28 [*] add delta endpoints and DRY deltaStreamBuilder
[cloud-core] add objectType to Metadata

[*] binding fixes to delta stream
2016-11-30 13:41:09 -05:00
Juan Tejada 64cb03f4cd Move non shared-models to local sync / remove duplicate DatabaseTypes 2016-11-26 12:48:48 -08:00
Juan Tejada 5b7214e464 [local-sync]: Let local-sync start, add loadModels to iso-core 2016-11-23 10:18:35 -08:00
Evan Morikawa cd65135feb [isomorphic-core] add trailing ./ 2016-11-23 09:34:38 -08:00
Evan Morikawa b5bf4e07c4 [isomorphic-core] Move files into src folder for isomorphic-core 2016-11-23 09:12:54 -08:00
Evan Morikawa 21977a25ca [isomorphic-core] Rename nylas-core -> isomorphic-core 2016-11-23 09:12:50 -08:00
Renamed from packages/nylas-core/index.js (Browse further)