Commit graph

5689 commits

Author SHA1 Message Date
Nylas Coffee Machine cc61b32710 bump(version): 1.0.50 2017-03-28 09:18:03 -07:00
Juan Tejada ff9d49e752 [client-app] Fix runtime error in FetchMessagesInFolderTask
We were accessing `this._db.accountId` before `this._db` was set, which
caused an error when attempting to run the task
2017-03-28 09:15:03 -07:00
Juan Tejada 1a1db50a84 [client-app] Update changelog 2017-03-28 09:10:15 -07:00
Juan Tejada caf5380659 [client-app] Fix importing SyncActivity
In some places we were not accessing `.default` when using `require`,
and when using `import` we couldn't really destructure unless we
accessed `.default` too, or if the functions were regular exports
instead of properties on a default exported object.

This was causing our sync loop to error.

To remain consistent, we always just `require` or `import` the
SyncActivity singleton and access that
2017-03-28 09:09:39 -07:00
Nylas Coffee Machine 60549fe8db bump(version): 1.0.49 2017-03-27 22:40:10 -07:00
Halla Moore adff6896e6 [client-sync] Change where we report sync activity
Summary:
These locations will provide enough activity for monitoring and are also
more helpful in helping us debug what the sync loop was doing when it
got stuck.

Test Plan: manual

Reviewers: juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4274
2017-03-27 21:49:56 -07:00
Evan Morikawa 83cab70d68 [client-app] add better documentation to windows update 2017-03-27 18:19:50 -07:00
Evan Morikawa ddee8b83f7 [client-app] directly call windows relaunch on squirrel update 2017-03-27 18:06:11 -07:00
Evan Morikawa fc5645b9eb [client-app] remap windows dev shortcuts 2017-03-27 17:13:42 -07:00
Evan Morikawa 44e51a0ed5 [client-app] only re-install for optional deps on mac 2017-03-27 17:00:38 -07:00
Halla Moore 4ad4596e2f [client-app, client-sync] Add specs for detecting stuck sync/worker window
Summary: See title. Part of T7681.

Test Plan: ran the specs

Reviewers: evan, mark, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4264
2017-03-27 15:45:33 -07:00
Halla Moore 73f0f3eeda [client-app] Detect when the worker window is unavailable
Summary:
Periodically ping client-sync's /health endpoint and store the latest
sync activity. If we get an ECONNREFUSED error, the worker window is
unavailable. Report the last known activity and restart the worker
window. Part of T7681.

Test Plan: manual, specs

Reviewers: evan, mark, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4263
2017-03-27 15:42:18 -07:00
Halla Moore 619c69a522 [client-sync] Detect when sync workers are stuck
Summary:
Periodically check the latest sync activity times to determine if a sync
worker has been inactive for too long. If it has been too long, discard
the worker and create a new one for that account. Part of T7681.

Test Plan: manual, specs

Reviewers: evan, mark, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4262
2017-03-27 15:41:31 -07:00
Halla Moore b6887e386e [client-sync] Report latest sync activity
Summary:
Add infrastructure to report and retrieve the latest sync activity, and
start reporting when we download a message or detect that a folder
has no new messages. This will be used to detect if the sync loop is
stuck. Part of T7681.

Test Plan: manual, specs

Reviewers: evan, mark, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4261
2017-03-27 15:39:53 -07:00
Halla Moore 7355527397 [client-app] Retry queries when database is locked
Summary:
We still don't know exactly what scenarios cause us to get 'database is
locked' errors, but generically this means that we have multiple
processes trying to access the database at the same time. In an attempt
to handle this gracefully, this diff makes it so that we retry the
queries in these cases. Theoretically, the database should free up once
the other process is done using it, and the erroring process just needs
to wait its turn. We still throw an error after 5 retries, so if there's
a larger issue, we'll still be able to tell in Sentry.

Addresses T7992

Test Plan:
I opened a transaction in the worker window and then tried to
do the same in the main window. If I didn't release the transaction in
the worker window, the main window eventually errored. If I did release
the transaction, the main window continued creating its own transaction.

Reviewers: mark, juan, evan

Reviewed By: juan, evan

Differential Revision: https://phab.nylas.com/D4254
2017-03-27 15:22:28 -07:00
Evan Morikawa b7036574d5 [*] add ONLY_CLIENT=false support for cloud & regular install 2017-03-27 14:40:28 -07:00
Juan Tejada 88dd9523ba [cloud-api] Timeout streaming API connections every 15 minutes
Summary: Should help a fair bit with our redis connection pileup.

Test Plan: Tested manually.

Reviewers: mark, spang, juan, evan

Reviewed By: mark, spang, evan

Differential Revision: https://phab.nylas.com/D3916
2017-03-27 12:13:34 -07:00
Christine Spang 951c874e2b [iso-core] Add indexes from SQL review
Summary:
These only really matter for n1cloud, and are being added manually in
production, so no migration file necessary. I am adding them to the
model definitions to prevent them getting out of sync with production
for development.

See T7999 for full SQL review

Test Plan: ship it

Reviewers: evan, khamidou, juan

Reviewed By: juan

Subscribers: vlad, jerm

Differential Revision: https://phab.nylas.com/D4230
2017-03-27 11:11:18 -07:00
Juan Tejada 9216ef1ca7 [client-app] Update changelog 2017-03-27 08:37:34 -07:00
Nylas Coffee Machine 8a3e47df4e bump(version): 1.0.48 2017-03-27 00:04:26 -07:00
Mark Hahnenberg 11aa686809 [client-app] Reindex threads when they're updated
Summary:
We weren't doing that, so we would have accurate search index info for
threads when they were, e.g., moved to another folder.

Test Plan: Run locally

Reviewers: spang, evan, juan

Reviewed By: evan, juan

Differential Revision: https://phab.nylas.com/D4260
2017-03-24 15:14:58 -07:00
Juan Tejada ae1c667e37 [client-app] Fix in identity store 2017-03-24 14:04:44 -07:00
Juan Tejada 41ad424752 [client-app] Don't try to restart sync on every IdentityStore change
Summary:
The IdentityStore can trigger any number of times, but we only want to
start sync if we previously didn't have an identity available

Test Plan: manual

Reviewers: spang, evan, halla

Reviewed By: evan, halla

Differential Revision: https://phab.nylas.com/D4246
2017-03-24 13:06:47 -07:00
Juan Tejada 43738771ac [client-app] Correctly remove inline images with x button
Summary:
Before this commit, it was impossible to remove inline images via the x
button

Test Plan: manual

Reviewers: mark, halla

Reviewed By: mark, halla

Differential Revision: https://phab.nylas.com/D4257
2017-03-24 13:03:28 -07:00
Juan Tejada cd6d04c4a6 [ei] Update changelog 2017-03-24 10:21:03 -07:00
Nylas Coffee Machine c5af73f358 bump(version): 1.0.47 2017-03-23 22:55:20 -07:00
Karim Hamidou a8aee89ae0 [client-app] Report hard crashes using Electron's built-in crash reporter
Summary:
I had a bit of downtime this morning so I decided to look into how to store Electron crash data. Electron, like Chromium, stores crash data in an arcane file format named minidump.

There's a bunch of services you can use to store files formatted in this format, like Mozilla's Socorro or zcbenz's own mini-breakpad-server but they're all pretty hard to install. Luckily, it turns out there's a Ruby gem to process minidump files and send them to Sentry! Seeing that, I whipped up a quick sinatra service and hosted it on Heroku – you can take a look at the source code here if you're curious: https://github.com/khamidou/electron-breakpad-sentry

This diff adds the client-side code we need to start sending crash reports.

Test Plan: Tested manually.

Reviewers: juan, evan

Reviewed By: juan, evan

Maniphest Tasks: T7926

Differential Revision: https://phab.nylas.com/D4259
2017-03-23 15:18:27 -07:00
Juan Tejada 09b88a759c [client-app] Consolidate file download metric reporting
Summary: See title

Test Plan: manual

Reviewers: gleb, mark

Reviewed By: mark

Differential Revision: https://phab.nylas.com/D4256
2017-03-23 13:26:28 -07:00
Juan Tejada 1298d4c529 [client-app] Update changelog 2017-03-23 12:23:34 -07:00
Mark Hahnenberg 4ef8e7614e [client-sync] Don't handle IMAP timeouts in the connection pool
Summary:
Different clients can have different policies for retrying after
timeouts.

Test Plan: Run locally, run tests

Reviewers: evan, spang, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4247
2017-03-23 11:33:53 -07:00
Mark Hahnenberg e13d4832ff [client-app] Record file download times
Summary:
We'd like to get an idea of how long the client app is having to wait
when requesting a file. Waiting can cause things like inline image
attachments to appear very slow to load.

Test Plan: Run locally

Reviewers: evan, spang, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4255
2017-03-23 11:32:19 -07:00
Nylas Coffee Machine ce17f70f26 bump(version): 1.0.46 2017-03-22 22:28:54 -07:00
Halla Moore 9caefdc687 [client-app] Rename downloadDataForFile(s) -> getDownloadDataForFile(s)
Summary:
The original name seems like it's initiating the download, when really
it's just returning the data of an already in-progress/completed
download.

Test Plan: Manual, specs

Reviewers: evan, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4251
2017-03-22 17:17:08 -07:00
Halla Moore 470e6563ec [client-app] Ensure files get transferred in forwarded messages
Summary:
We need to download the files and then treat them as uploads. Rather
than using an actual Upload object, which would require another data
transfer, we create an object with all the necessary Upload-like
properties and point it to the downloaded file.

Addresses part of T7960

Test Plan: Manual, some specs

Reviewers: evan, spang, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4249
2017-03-22 12:05:35 -07:00
Karim Hamidou 3e3b0b84f1 Switch type of Metadata value column
Summary:
Found a funny send-later bug I didn't catch when testing on staging: sometimes the data we're saving in the metadata table overflows. That's because MySQL's TEXT column are at most 64k, which is easy to reach when you have a draft + clearbit information and additional stuff.

To work around this, I decided to switch the database type of the metadata table to LONGTEXT. Since it can store 4Gb of text, we should be good. This diff makes those code changes. Obviously, we'll have to run migrations both on staging and prod.

Test Plan: Ran a basic smoke test. Shouldn't break anything.

Reviewers: juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D4250
2017-03-22 12:03:11 -07:00
Karim Hamidou 1f9c5120cd Fix build condition
On the server the env var is defined but set to false.
2017-03-22 11:06:59 -07:00
Halla Moore b849793a72 [client-app] Fix DraftFactory specs
Summary: Using `await` instead of `advanceClock()` fixes all the things!

Test Plan: Ran the spec file

Reviewers: evan, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4248
2017-03-21 15:46:48 -07:00
Mark Hahnenberg 2fe8bee38f [client-sync] Refactor sync worker IMAPConnectionPool callbacks
Summary: In preparation for removing timeout handling from the IMAPConnectionPool.

Test Plan: Run locally

Reviewers: spang, evan, juan

Reviewed By: evan, juan

Differential Revision: https://phab.nylas.com/D4245
2017-03-21 12:15:40 -07:00
Juan Tejada 65f9f8cdbe [client-app] 🎨 comment 2017-03-21 11:45:30 -07:00
Juan Tejada 8f5d36746d [client-app] Correctly sign out of NylasID
Summary:
This fixes T7995.

Previously, attempting to log out from your NylasID would just
automatically sign you back in with the same NylasID because the webview
session was preserved.

Now, instead of relaunching the windows, we restart the app to clear the
webview session

Test Plan: manual

Reviewers: halla, evan

Reviewed By: evan

Maniphest Tasks: T7995

Differential Revision: https://phab.nylas.com/D4224
2017-03-21 11:44:48 -07:00
Juan Tejada 6ea9ab3fbf [client-app] Don't report non-reportable errors in delta connection
Summary:
Previously, the logic for deciding wether to report an APIError lived
inside NylasAPIRequest and depended on an array of ignorable
statusCodes. However, when handling APIErrors, NylasAPIRequest would
convert special error codes (for offline errors) into a statusCode of 0,
which would automatically be ignored.

Given that the delta streaming connection didn't convert status codes to
0, it wouldn't actually ignore the error and end up reporting it,
flooding sentry.

This commit makes it so that that logic lives inside APIError, and
anyone who handles APIErrors can check wether to report them or not,
including the delta streaming connection

Test Plan: manual :(

Reviewers: spang, evan, halla

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D4235
2017-03-21 11:43:41 -07:00
Juan Tejada 6048d6a80c [client-app] Update changelog 2017-03-21 10:39:40 -07:00
Nylas Coffee Machine 3b3057fd2d bump(version): 1.0.45 2017-03-21 09:30:12 -07:00
Juan Tejada d025aaf369 [dev] Actually fix tmp dir path in daily 2017-03-21 09:29:46 -07:00
Juan Tejada 17da34caed [dev] Fix temp dir path in daily 2017-03-21 09:25:46 -07:00
Juan Tejada 3554fb2510 [client-app] Fix passing cursor to delta streams
Summary:
Currently, when we auth an account for the first time in Nylas Mail (or
we blow away the database), the app is going to request transactions
since cursor `null` from the /delta/streaming endpoint and from the local-sync
delta observable, instead of requesting transactions since cursor `0`

This is due to a subtle bug with the use of default values when
destructuring an object. Our coded did the following:
```
const {cursor = 0} = this._state
```
Which at a glance seems correct. However, this will only work as
expected if `this._state` has the following shape:
```
{cursor: undefined}
```
And unfortunately, our `this._state` looked like this when authing an
account for the first time:
```
{cursor: null}
```

Which would make `cursor === null` instead of `0`.
This is because when using default values, null is considered an
intentional argument/value, as opposed to not passing any argument/value
(which will mean that the argument is undefined).

This was a regression introduced in d60a23c and 8bc2ec5

Test Plan: manual, will add regression test in upcoming diff

Reviewers: evan, spang, halla

Reviewed By: halla

Differential Revision: https://phab.nylas.com/D4243
2017-03-20 16:16:46 -07:00
Juan Tejada 3909c8885a [cloud-api] Fix query for delta stream transactions
Summary:
When querying transactions for the delta stream, if no cursor is provided,
we should default to 0. Otherwise this will generate a query like:
```
WHERE `transaction`.`id` > ‘null’
```
Which is obviously wrong

Test Plan: manual

Reviewers: evan, halla, spang

Reviewed By: spang

Differential Revision: https://phab.nylas.com/D4242
2017-03-20 15:39:24 -07:00
Nylas Coffee Machine d5b8e1993e bump(version): 1.0.44 2017-03-20 08:37:27 -07:00
Jeremy Price 180f92b78a [deploy-it] temp override for deploy branch rules
for ei-prod only.  I set up the ei EB env as prod level, but
have been working on launch changed in master branch. Easy enough to undo,
but I didn't wan't to mess with prod branch until done because
the launch scripts affect all the n1cloud-related environments.
2017-03-18 15:26:08 -07:00
Juan Tejada 6532d3c647 [client-sync] Add error handling when creating syncback requests
Summary: see title. also convert to es6

Test Plan: manual

Reviewers: evan, halla

Reviewed By: halla

Differential Revision: https://phab.nylas.com/D4225
2017-03-17 13:59:37 -07:00