Commit graph

5588 commits

Author SHA1 Message Date
Juan Tejada a8fe22551f [client-app] Make sure we retry delta connection when reauthing account
Summary: See title

Test Plan: manual

Reviewers: halla, evan

Reviewed By: halla, evan

Differential Revision: https://phab.nylas.com/D4176
2017-03-09 21:50:39 -08:00
Juan Tejada d24fc9a235 [client-app] More defensive error handling to prevent sync from halting
Summary:
This commit adds error handling to the sync-loop's `onSyncError` and
`scheduleNextSync`.

These functions generally don't fail, as they are in the `catch` and
`finally` blocks respectively of the sync loop. But as we've seen in
D4152, the datbase can sometime error if it's in a bad state. If it
errors inside these functions, we will never schedule the next run of
the sync loop.

Depends on D4152

Test Plan: manual

Reviewers: evan, spang, mark, halla

Reviewed By: halla

Differential Revision: https://phab.nylas.com/D4153
2017-03-09 21:22:07 -08:00
Juan Tejada d2cd0db335 [client-app] Prevent delta streaming connection from retrying too much
Summary:
Before this commit, we would call .close() onError and when the
connection closed. We also closed the connection onError, even though
NylasLongConnection had also closed it, so we ended up calling close a
bunch of times. This would cause us to set a bunch of timeouts to retry
unecessarilly.

This commit makes it so we ensure there's only one retry timeout and
consolidates the logic that calls .close() so we don't call it so many
times unnecessarily

Test Plan: manual

Reviewers: spang, mark, evan

Reviewed By: mark, evan

Differential Revision: https://phab.nylas.com/D4166
2017-03-09 15:28:23 -08:00
Juan Tejada da463c250f [client-app] Consolidate delta connection stores, rm deltas internal_pkg
Summary:
This commit consolidates the `DeltaConnectionStatusStore` and the
`DeltaConnectionStore` which kept track of very similar state and made
sense to be the same store (as per feedback in D4118#77647)

Given that this state needs to be available app-wide for plugins to
query the status of delta connections, `internal_packages/deltas` was
removed (given that it only activated that store), in favor of having the
unified store inside `src/flux/stores` and available via `nylas-exports`

The `deltas` package also contained some contacts-ranking code, which is
no longer in use until we restore that fetaure, so I created a
`internal_packages/contact-rankings` which contains this unused code for
now.

Test Plan:
manually open, close, end delta connections, verify that I'm getting
correct results. unit tests to come

Reviewers: halla, spang, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D4145
2017-03-09 15:27:06 -08:00
Juan Tejada 7b9680fff4 [client-app] 🎨 Rename NylasSyncStatusStore to FolderSyncProgressStore
Summary: see title

Test Plan: manual

Reviewers: evan, spang, halla

Reviewed By: halla

Differential Revision: https://phab.nylas.com/D4141
2017-03-09 15:24:43 -08:00
Juan Tejada aaf4cb60b2 [client-app] Consolidate apierror status code that we should not report
Summary:
This DRY's up code that use these status codes

Depends on D4130

Test Plan: manual

Reviewers: spang, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D4140
2017-03-09 15:24:06 -08:00
Juan Tejada 667e1d6691 [client-app] Fix error when attempting to report a fetch id error
Summary:
When reporting error inside `IdentityStore._fetchIdentity`, we would
pass null as the `extra` parameter for `reportError`. This would cause
us to try to assign something to null and throw an error while reporting
the error.

(Even though `extra` has a default value of `{}` (see
declaration of `NylasEnv.reportError`), passing null will be interpreted
as a valid arg and it wont get assigned the default value)

Thankfully, the second error /is/ reported to sentry: https://sentry.io/nylas/nylas-mail/issues/230589717/

Test Plan: manual

Reviewers: mark, halla, spang, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D4150
2017-03-09 15:22:34 -08:00
Juan Tejada 20a05d3340 [client-app] Rate limit error reporting for message processing errors
Summary:
This should prevent us from flooding Sentry with errors like this one:
https://sentry.io/nylas/nylas-mail/issues/230605150/

Test Plan: manual

Reviewers: spang, mark, halla, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D4151
2017-03-09 15:22:08 -08:00
Juan Tejada 521ca86efc [client-app] Prevent database malformed error restart loop
Summary:
This error is can flood Sentry pretty badly: https://sentry.io/nylas/nylas-mail/issues/230629801/

My initial thought was to rate limit it, but rate limiting wouldn't
do any good because when we get that error we destroy the databases and
restart the app, and we will loose the in-memory rate limiting data.

The real fix, and reason why Sentry is being flooded with this error by
a single user, is that once you encounter this error the app will enter
a restart loop that constantly throws this error. The reason being that
we weren't properly awaiting for the K2 account databases to be dropped
before closing the app, so on restart, the database would still be
malformed.

The fix is to properly `await` for the database drops

Test Plan: manual

Reviewers: spang, mark, halla, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D4127
2017-03-09 15:21:07 -08:00
Mark Hahnenberg 6a17073fe5 [client-sync] Refactor file download IMAP pool use
Summary:
This is in preparation for removing the ability of the IMAP pool to
automatically handle timeout errors.

Test Plan: Run locally, verify file download still works

Reviewers: juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4167
2017-03-09 14:47:07 -08:00
Mark Hahnenberg 19528ca78a [client-sync] Refactor raw message IMAP connection pool use
Summary: In preparation for removing timeout handling from IMAPConnectionPool.

Test Plan: Run locally

Reviewers: juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4168
2017-03-09 14:46:51 -08:00
Mark Hahnenberg acd3bf5954 [client-sync] Refactor _search Observable
Summary:
We had this weird nesting where we would keep the IMAPConnection open
beyond the scope of the connection pool and return the created
Observable. This diff inverts that relationship and flattens out some of
the indentation, making the code easier to read. This is in preparation
for refactoring the IMAPConnectionPool to no longer automatically handle
timeouts.

Test Plan: Run locally, make sure search still works

Reviewers: juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4165
2017-03-09 14:26:06 -08:00
Christine Spang bb18f98b83 [client-app] Don't report incorrect username or password to Sentry
Summary:
This is not a bug. Maaaybe we want to report this to MixPanel for individual
user debugging (how do we do that?), but it doesn't make sense to report this
error to Sentry.

Example:

https://sentry.io/nylas/nylas-mail/issues/230530818/

Test Plan: yolo

Reviewers: mark, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4130
2017-03-09 12:26:34 -08:00
Mark Hahnenberg 0ccb2b51ad [client-sync] Make cancelling SyncUnknownUIDs actually work
Summary: Misspelled INPROGRESS-NOTRETRYABLE :-(

Test Plan: Run locally, make sure things get cancelled

Reviewers: juan

Differential Revision: https://phab.nylas.com/D4163
2017-03-09 12:25:54 -08:00
Evan Morikawa 3c8925ef76 [client-app] don't re-close dev tools
Summary:
If you have the console open and are looking at the Source panel or
something, this will constantly bring you back to the Console panel. Won't
do that anymore with this chec

Test Plan: manual

Reviewers: spang, mark, halla, juan

Reviewed By: mark, halla, juan

Differential Revision: https://phab.nylas.com/D4162
2017-03-09 15:14:16 -05:00
Evan Morikawa 3e895c74c9 [client-app] fix circular errors and logging
Summary:
Errors weren't getting reported because of a circular reference causing
JSON.stringify to fail.

We can't add the whole API `response` object onto the error object,
because sometimes (like when the delta connection errors with a 401), the
`response` object is circular. We only use it to the extract the status
code anyway and it's a huge object. This diff excludes them from the
APIError objects.

We also have code to recover just in case JSON.stringify errors for some
other weird reason. It'll still attempt to report the error prefixed with
`Recovered Error`

Finally, we used to spit only the `error.stack` to the console. This meant
what we saw in the console didn't properly include the error messages
being incredibly not useful.

It's better to console.error the whole error object since that'll more
nicely display on the inspector console

Test Plan: manual

Reviewers: juan, spang, mark, halla

Reviewed By: halla

Differential Revision: https://phab.nylas.com/D4154
2017-03-09 15:11:36 -05:00
Mark Hahnenberg 47f57a6c02 [client-sync] Gracefully handle large amounts of unknown UIDs from search
Summary:
Previously if we got back a huge number of unknown UIDs from IMAP search
we would try to sync all of them at once. This could lead to hanging the sync
loop trying to download tons of messages. This diff limits the UIDs we're
willing to sync per task to 500 and splits each task up into chunks of 25
messages so that we don't try to download all of them at once. If we need
to sync more than 500 uids then at the end of the syncback task it will
queue another task to run the next time the sync loop rolls back around.

Test Plan:
Run locally, verify that we gracefully handle various situations
including cancelling during the syncback task, cancelling between syncback
tasks, huge numbers of results, etc

Reviewers: evan, spang, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4142
2017-03-09 11:47:18 -08:00
Mark Hahnenberg 1c1459f306 [client-sync] Make SyncUnknownUIDs NOTRETRYABLE
Summary:
We don't want to constantly retry to sync a bunch of random UIDs if
we're not longer in the search perspective so make these syncback tasks
not retryable.

Test Plan: Run locally, verify that we don't retry

Reviewers: spang, evan, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4149
2017-03-09 11:07:38 -08:00
Juan Tejada cd21e6087d [client-app] Correctly set process title 2017-03-09 10:59:23 -08:00
Juan Tejada d92969efc3 [client-app] Update changelog 2017-03-09 09:53:30 -08:00
Juan Tejada f6791925c5 [client-app] Update changelog 2017-03-09 08:22:28 -08:00
Juan Tejada 0f2896446e [client-sync] Bump sequelize version - Ensure it doesn't halt sync
Summary:
This commit bumps the version of sequelize to point to the latest
version in our fork. This version bump also includes latest updates from
upstream sequelize since the last time we bumped the version.

Notably, it includes a critical fix that will prevent the sync
loop from getting stuck on rare occasions.

Specifically, sequelize's `Query.prototype.run` could in some cases return a
Promise that would /never/ resolve or reject, effectively halting the
execution of any code that was waiting for that promise. This was due to
a lack of error handling inside a the query's `afterExecute` function; if an
error was thrown there, the enclosing Promise would never reject, and
the error would just remain uncaught. An example of such an error that
could cause this scenario is: T7742 - https://sentry.io/nylas/nylas-mail/issues/230016155/

Sync getting halted in this way can produce a variety of user facing
bugs like not being able to send or it taking an absurd amount of time
(hours), tasks never finishing or taking an absurd amount of time to
complete, new mail not arriving, among others

The commit that fixes this is: 0deeda9e1a
The full set of changes introduced by this version bump are: https://github.com/nylas/sequelize/compare/nylas-3.30.0...nylas-3.40.0

**Note:**
It is important to note that sequelize might still halt the sync loop if
there are other places in the code that can return Promises that never
resolve or reject under certain circumstances. I can consistently reproduce this
scenario when an error is thrown inside `afterExecute`, and I've seen it
happen in the wild, but I've also ran into this type of sync loop halting (db
promises never resolve) without any sequelize errors being thrown, which
suggests that there are other places in the sequelize code that might end
up returning a Promise that will halt sync.

Unfortunately, we don't have a good way to detect and report when this
happens yet, but we are adding one in upcoming diffs in order have data
on how many people are running into this, and/or if this patch completely
fixes the issue. Otherwise, we'd need to audit sequelize's code.

Should resolve T7837 and T7767

Test Plan: manual

Reviewers: spang, mark, halla, khamidou, evan

Reviewed By: evan

Subscribers: mg, tomasz

Maniphest Tasks: T7767, T7837

Differential Revision: https://phab.nylas.com/D4152
2017-03-09 08:20:49 -08:00
Juan Tejada 7649c8ed53 [none] (dev) Fix npm version bump path in script/daily 2017-03-08 22:32:47 -08:00
Juan Tejada d95ee3aba1 bump(version): 1.0.34 2017-03-08 22:28:39 -08:00
Juan Tejada a7e5d814df [none] (dev) Fix paths in scripts/daily 2017-03-08 22:24:17 -08:00
Mark Hahnenberg e441632293 [client-sync] Refactor message processing throttling
Summary:
We want to enable code to control whether fetching is throttled or not.
We basically only want to throttle syncing the historical message
archive. New messages, initial inbox sync, and unknown search results
should not be throttled. Also some drive-by code refactoring.

Test Plan: Run locally, verify that things still work

Reviewers: spang, evan, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4126
2017-03-08 14:18:44 -08:00
Juan Tejada 12cbd383bf [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
2017-03-08 12:12:50 -08:00
Juan Tejada 52b04bcb39 [client-app] (deltas P5) Move DeltaProcessor to nylas-exports
Summary:
This is to make it available to all plugins in the app
Depends on D4120

Test Plan: manual

Reviewers: halla, mark, spang, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D4121
2017-03-08 12:09:31 -08:00
Juan Tejada 321c583d60 [client-app] (deltas P4) Fixup DeltaStramingConnection + retry on close
Summary:
This commit completely refactors `DeltaStreamingConnection`, notably
introducing the following changes:

- Right now, `AccountDeltaConnection` establishes both delta connections to the cloud api and to the `client-sync` database (K2). This class is meant to disapper in favor of splitting into two different classes meant for syncing with the n1Cloud api and the local database. Specifically, `DeltaStreamingConnection`'s only responsibility is now to connect to the n1Cloud API and establish an http streaming connection for metadata deltas, etc. This class no longer unecessarily inherits from `NylasLongConnection`, which removes a lot of unecessary callback indirection.
- The statuses of the n1Cloud delta streaming connections are now stored in as JSONBlobs in edgehill.db under new keys. This commit ensures that the data is correctly migrated from the old key (`NylasSyncWorker:<account_id>`).
- The `DeltaStreamingConnection` now correctly retries when closed or errors. This logic previously existed, but was removed during the K2 transition: https://github.com/nylas/nylas-mail/blob/n1-pro/internal_packages/worker-sync/lib/nylas-sync-worker.coffee#L67
- Delta connection retries now backoff using the `ExponentialBackoffScheduler`
- Attempt to restore the delta connection whenever the app comes back online

Depends on D4119

Test Plan: manual + planned unit tests in upcoming diff

Reviewers: halla, mark, evan, spang

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D4120
2017-03-08 12:08:41 -08:00
Juan Tejada 54f918c862 [client-app] (deltas P3) Change onResults interface in NylasLongConnection
Summary:
For legacy reasons, NylasLongConnection did not take the `onResults`
callback as an option, but rather it was a method you had to call on the
connection, which took the callback, and which you had to call after
instantiating the connection. This was an annoying and clunky interface.

This commit makes it so NylasLongConnection takes an `onResults` option
as one would expect it to, and updates any references to the old
interface

Depends on D4118

Test Plan: manual

Reviewers: halla, mark, spang, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D4119
2017-03-08 12:02:08 -08:00
Juan Tejada 47b311ce0c [client-app] (deltas P2) 🎨 Split up NylasSyncStatusStore
Summary:
Turns out, NylasSyncStatusStore doesn't need to concern itself with the
status of delta connections.

This is legacy cruft from the days when this store used to provide the
online status of the app based on the delta connections. Now we have an
OnlineStatusStore, so we don't need this at all

Instead of stuffing that state in that store, this commit adds a small
DeltaConnectionStatusStore to provide an easy way to listen to changes
on the status of delta connections. The only part of the app concerned
with that state is the DeveloperBarStore in order to render the green
circles for delta connections in the worker window.

Depends on D4117

Test Plan: manual

Reviewers: mark, halla, spang, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D4118
2017-03-08 12:00:07 -08:00
Juan Tejada a6aa37c448 [client-app] (deltas P1) 🎨 Fixup AccountDeltaConnectionPool
Summary:
- Rename to `DeltaConnectionManager`
- Convert main.coffee to main.es6
- Use async/await

Test Plan: manual

Reviewers: halla, mark, evan, spang

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D4117
2017-03-08 11:58:25 -08:00
Juan Tejada c0715bfb6d [none] (dev) Add script/daily
Summary:
Generating the daily build always takes a bit of effort, so I wrote the
script to automate the process and allow anyone to do it as well.

This script will:

- Check your current working directory is in a good state
- Bump the version number in package.json
- Edit CHANGELOG.md with the git log diff between current master and the last version tag (you can also manually edit it). This is so writing the CHANGELOG before a release takes less effort; you will just need to open the CHANGELOG file and edit the commit messages.
- Commit the changes with a commit message of: bump(version) <next_version>
- Add new version tags to nylas-mail and k2
- Push the changes to Github
- If provided with the flag, it will build the app. This is intended to be used in our mac mini machine

There are a few TODO's left in here, like updating the daily channel,
and emailing a notification when the channel is updated with the buid urls.

When this lands, we will configure our mac mini to run this script daily/nightly.
Also, any engineer should be able to trigger a daily build easily by just
running this script.

For sample output, see this commit which was generated by this script:
000fa88ebb

Test Plan: manually running it

Reviewers: halla, spang, mark, khamidou, evan

Reviewed By: evan

Subscribers: tomasz

Differential Revision: https://phab.nylas.com/D4123
2017-03-08 11:54:49 -08:00
Juan Tejada ef4778d12a [client-app] Handle errors when opening imap box correctly
Summary:
If an error is thrown while opening an imap box, we need to make sure to
set the `_isOpening` back to false

Test Plan: manual

Reviewers: mark

Reviewed By: mark

Differential Revision: https://phab.nylas.com/D4134
2017-03-08 11:17:28 -08:00
Christine Spang bec943e1e3 [iso-core] Provide better info to Sentry on send errors
Summary:
In many cases when send fails, the server settings may be incorrect.
Send this data to Sentry with the original error in order to help us
diagnose.

I think the grouping will only contain settings for a single user
getting the same error, but should still be good enough to do further
investigation, e.g. https://sentry.io/nylas/nylas-mail/issues/230529222/

We can always go look up the requests in the n1Cloud logs if more info is
needed.

Test Plan: yolo

Reviewers: mark, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4131
2017-03-08 10:57:22 -08:00
Juan Tejada 4fd1f3e97d bump(version) 1.0.33 2017-03-07 23:06:28 -08:00
Christine Spang 49c6a8cdcd [client-app] Differentiate APIError by URL also
Summary:
We have a bunch of different endpoints and it'd be helpful to know which
endpoints are failing, not just which status codes are being thrown. e.g. while
trying to reproduce send failures, I've been able to cause /auth to fail with a
504, but I couldn't tell which endpoint was failing with the 504 until I added
this extra differentiator.

Test Plan: manual

Reviewers: mark, juan

Reviewed By: mark, juan

Differential Revision: https://phab.nylas.com/D4128
2017-03-07 18:41:26 -08:00
Christine Spang 9bdf8ae763 [client-app,cloud-{api,workers}] Bump raven version
Sentry is complaining that we're sending events using an old SDK.
2017-03-07 17:41:33 -08: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 14ca01af31 [client-app] 🎨 rename for consistency 2017-03-07 15:15:52 -08:00
Juan Tejada 9e91d9518a [none] (dev) Fix script name 2017-03-07 12:33:29 -08:00
Mark Hahnenberg f68b999687 [env] Don't generate sourceMapCache in prod mode
Summary:
Keeping a sourceMapCache uses a great deal of memory. Don't do it if we
don't have to.

Test Plan: Run locally, verify that we no longer generate a sourceMapCache

Reviewers: evan, juan, spang

Reviewed By: evan, juan, spang

Differential Revision: https://phab.nylas.com/D3964
2017-03-07 12:00:35 -08:00
Evan Morikawa 5024f9c2cc [client-app] also upload a next-version to S3 for autoupdate testing
Summary:
We never want to ship the last release we'll ever ship.
This can happen if the new version's autoupdater is broken.
To test this we upload to a version n+1 higher than the current one.

Test Plan: manual

Reviewers: juan, spang, halla

Reviewed By: halla

Differential Revision: https://phab.nylas.com/D4125
2017-03-07 14:54:50 -05:00
Evan Morikawa a4de75d3ec [dev] change npm script names
Summary:
`npm run cloud` felt nicer than:
`npm run start-cloud`

Test Plan: manual

Reviewers: juan, spang, mark, khamidou, halla

Reviewed By: halla

Differential Revision: https://phab.nylas.com/D4124
2017-03-07 14:54:30 -05:00
Evan Morikawa 67b7a335de [dev] use .cmd versions for Windows
Since spawn on Windows can't accept scripts like exec can :(
2017-03-07 14:50:34 -05:00
Evan Morikawa fc3dde9111 [dev] fix AppVeyor lerna bootstrap command
Needs to include `.cmd` for windows lerna builds
2017-03-07 14:43:45 -05:00
Mark Hahnenberg b119b43f82 [client-sync] Don't throttle message processing when syncing specific UIDs
Summary:
This diff adds a timeout parameter to queueMessageForProcessing that can
be used to override the CPU-throttled-by-default timeout used by the
message processing queue. The FetchMessagesInFolder sync task now
overrides with a timeout of 0 when it is queuing specific UIDs that it
has downloaded. The thinking here is that if we've requested a specific
set of UIDs, it's very important to sync those quickly as this indicates
a higher priority (e.g. initial inbox sync, search result syncing, etc).

Test Plan: Run locally, verify that initial sync and search syncing run faster

Reviewers: spang, evan, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4114
2017-03-07 11:34:19 -08:00
Mark Hahnenberg 280a5ba6e2 [client-sync] Fetch unknown search results
Summary:
When searching using IMAP/Gmail commands we sometimes get back UIDs for
messages that we have yet to sync. Previously we would just ignore these
results, which would decrease the quality search results for quite some
time during initial sync. This diff enables us to eagerly sync the unknown
messages we get back from the provider by creating a syncback task which
interrupts the sync loop and runs a sync task for the unknown UIDs.

Test Plan: Run locally, verify that we sync unknown messages

Reviewers: spang, evan, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4101
2017-03-07 11:30:58 -08:00