Commit graph

5439 commits

Author SHA1 Message Date
Juan Tejada feda238d9c [client-app] Measure and record times for opening account windows
Summary: See title

Test Plan: manual

Reviewers: spang, halla, evan

Reviewed By: halla, evan

Differential Revision: https://phab.nylas.com/D4017
2017-02-22 17:09:42 -08:00
Juan Tejada ecf3709669 [client-app] Measure and report composer window open times
Summary: To Mixpanel and Honeycomb.

Test Plan: manual

Reviewers: spang, halla, evan

Reviewed By: halla, evan

Differential Revision: https://phab.nylas.com/D4016
2017-02-22 17:08:31 -08:00
Juan Tejada b819889b36 [client-app] Measure and report task performLocal times
Summary: See title

Test Plan: manual

Reviewers: evan, spang, halla

Reviewed By: halla

Differential Revision: https://phab.nylas.com/D4015
2017-02-22 16:47:15 -08:00
Juan Tejada ae9aede300 [client-app] Measure and report sending times
Summary: See title

Test Plan: manual

Reviewers: spang, halla, evan

Reviewed By: halla, evan

Differential Revision: https://phab.nylas.com/D4014
2017-02-22 16:45:08 -08:00
Juan Tejada 4c57fcfab4 [client-app] Measure and report time to select and load a thread
Summary: See title

Test Plan: manual

Reviewers: spang, halla, evan

Reviewed By: halla, evan

Differential Revision: https://phab.nylas.com/D4013
2017-02-22 16:39:34 -08:00
Juan Tejada c4ec2d6bb7 [client-app] Report thread-list action perf metrics to Mixpanel
Summary: See title

Test Plan: manual

Reviewers: spang, halla, evan

Reviewed By: halla, evan

Differential Revision: https://phab.nylas.com/D4011
2017-02-22 16:37:30 -08:00
Juan Tejada 223858510c [*] Fixup MetricsReporter
Summary:
Fix errors and inconsistencies in MetricsReporter code like:

- We were modifying the passed in data object in place
- We were accessing NylasEnv without knowing we were in client env to
get the version
- We were creating an incorrect logger instance

Test Plan: manual

Reviewers: spang, halla, evan

Reviewed By: halla, evan

Differential Revision: https://phab.nylas.com/D4010
2017-02-22 16:36:29 -08:00
Juan Tejada aa0bde0c41 [client-app] Add Actions.recordPerfMetric
Summary:
This action will report perf metrics to honeycomb /and/ mixpanel. This
commit also fixes up Analytics Store a little bit

Test Plan: manual

Reviewers: spang, halla, evan

Reviewed By: halla, evan

Subscribers: jerm

Differential Revision: https://phab.nylas.com/D4012
2017-02-22 16:35:38 -08:00
Evan Morikawa 7b7318b220 [client-app] update Travis
Summary:
Also see:
3a33b0ad64
which was hot-pushed to master in order to get Travis building.

We now have two travis files:

1. /.travis.yml
2. /packages/client-app/travis.yml

The first one is alwas in the private repo and runs `npm install && npm
run build-client`. This decrypts our keys and signs, builds, and uploads
to S3.

The second one is designed to live in our yet-to-be public mirror. It will
basically just run `npm install && npm test`.

That way the public one should just about ALWAYS pass (YAY!) except of
course when you break the tests or something in the installer!

Test Plan: Run on new https://travis-ci.com/nylas/nylas-mail-all

Reviewers: jerm, spang, juan

Reviewed By: spang, juan

Differential Revision: https://phab.nylas.com/D3999
2017-02-22 16:19:45 -05:00
Halla Moore 87aa1a86ad [*] Make sure cloud deploy can access .babelrc
Summary:
Now that .babelrc is in client-app, we need to make it an exception in the
.dockerignore file. Additionally, this means that the client-app directory will
exist during the postinstall script in the cloud environment, so we need a
stricter check to figure out if the client-app needs to be built or not.

Test Plan: deployed to staging

Reviewers: evan, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4008
2017-02-22 12:09:14 -08:00
Mark Hahnenberg c77c8becb9 [client-sync] Use IMAPConnectionPool for IMAP search client
Summary: See title

Test Plan: Run locally, verify IMAP search still works

Reviewers: evan, spang, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4006
2017-02-22 10:57:42 -08:00
Mark Hahnenberg a912dc971c [client-sync] Use IMAPConnectionPool for downloading raw messages
Summary: See title

Test Plan: Run locally, verify we can download raw messages

Reviewers: evan, spang, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4005
2017-02-22 10:55:08 -08:00
Mark Hahnenberg c4ccd8aac4 [client-sync] Use IMAPConnectionPool for downloading files
Summary: See title

Test Plan: Run locally, verify downloading files works

Reviewers: evan, spang, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4004
2017-02-22 10:48:26 -08:00
Halla Moore 44f5cc580b [isomorphic-core] Require .default
Add missing `.default` to LibHoney require
2017-02-21 18:05:12 -08:00
Juan Tejada c24c5bc341 [client-app] Update changelog 2017-02-21 17:44:23 -08:00
Mark Hahnenberg 7b55691cee [client-app] Don't compute thread search index size on startup
Summary:
We did this to see if we should clear the index, which no longer makes
sense because the index never exceeds our threshold. Additionally, none
of the other search indexes do this. This was causing us to spend a ton
of time scanning the ThreadSearch table at startup.

Test Plan: Run locally, make sure things are fine

Reviewers: evan, spang, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4007
2017-02-21 16:39:51 -08:00
Christine Spang 84a3b20839 [client-sync] Refresh SMTP client when auth credentials change
Summary:
Previously, we would create a nodemailer SMTP transport object when the
sync worker booted up. The transport object would be passed the account
SMTP credentials at the time of object creation. If the Google auth
token later expired, we would continue to try to send mail using the
expired token, resulting in "Invalid login" failures.

This patch makes it so we refresh the transport object if the auth token
changes, and also turns on SMTP connection pooling to limit simultaneous
SMTP connections (& maybe make sending multiple messages faster).

Fixes T7891

Test Plan: manual

Reviewers: juan, halla

Reviewed By: juan, halla

Subscribers: mark

Maniphest Tasks: T7891

Differential Revision: https://phab.nylas.com/D3997
2017-02-21 16:24:24 -08:00
Christine Spang ee5abf22eb [iso-core] Fix Office365 sending from the mail app
Summary:
This fixes a regression introduced in D3980 that prevented sending from working
on Office365 and generic IMAP accounts.

Fixes T7892

Test Plan: manual - we could use unit tests for this but need to set up tests for iso-core first

Reviewers: juan, halla, evan

Reviewed By: halla, evan

Maniphest Tasks: T7892

Differential Revision: https://phab.nylas.com/D4003
2017-02-21 15:59:12 -08:00
Juan Tejada 1485575e48 [client-app] Fix build
Partially revert 3071856a8e

Symlinking instead of copying the error-logger-extensions prevents the
app from finding the appropriate dependencies required in the error
logger extensions in the main process and in the renderer processes
because globalPaths are only set in renderer processes and /after/
error-logger-extensions are loaded.

We should fix this properly in a separate diff, and move the error
logger to isomorphic-core instead of copying it or symlinking it
2017-02-21 15:57:38 -08:00
Halla Moore 1105b2621f [*] Rename postinstall.js -> postinstall.es6
The n1Cloud machines try to compile this script, even though they
never run it, and they didn't recognize it was supposed to be es6
2017-02-21 15:55:08 -08:00
Juan Tejada a29dfcf56c [client-sync] Fix sending per recipient
Summary: This was broken, oh so broken

Test Plan: manual

Reviewers: halla, spang, evan, mark

Reviewed By: mark

Differential Revision: https://phab.nylas.com/D4001
2017-02-21 15:24:21 -08:00
Juan Tejada 1722e8bb39 [*] Catch more invalid login errors when sending
Summary: See title

Test Plan: manual

Reviewers: evan, halla, spang

Reviewed By: halla, spang

Differential Revision: https://phab.nylas.com/D3994
2017-02-21 14:58:31 -08:00
Evan Morikawa 3a33b0ad64 [client-app] update build system 2017-02-21 17:32:22 -05: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 66873e3f9e bump(version) 1.0.29 2017-02-21 13:12:09 -08:00
Evan Morikawa 3071856a8e [client-app] symlink in babelrc and resolve links
Summary:
The prod build was failing because it couldn't find the .babelrc.

I decided to put the babelrc in the main nylas-mail repo with the
expectation that it'll need to be in the open source version too. To DRY
up this for us building, we sylink the root one to the client-app babelrc

Also since we now dereference symlinks we don't need to do the full copy
of nylas-private-resources so we don't have two error reporters floating
around

Test Plan: npm run build-client

Reviewers: juan, spang

Reviewed By: juan, spang

Differential Revision: https://phab.nylas.com/D3993
2017-02-21 16:08:59 -05:00
Christine Spang 776cf26d7a [client-app] Convert nylas-env.coffee to ES6 😓
Test Plan: unit tests + run the app

Reviewers: juan, halla, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D3979
2017-02-21 12:38:36 -08:00
Juan Tejada 15bcf974d2 [client-app] For consistency, proxy marking unread thru ThreadListActionStore
Summary: Depends on D3990

Test Plan: manual

Reviewers: spang, halla, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D3992
2017-02-21 12:31:07 -08:00
Juan Tejada 20f7ae47ca [client-app] For consistency, proxy starring thru ThreadListActionStore
Summary: See title

Test Plan: Depends on D3990

Reviewers: spang, halla, mark, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D3991
2017-02-21 12:29:52 -08:00
Juan Tejada 19195e9686 [client-app] Measure and report times for trashing and marking as spam
Summary:
See title

Depends on D3989

Test Plan: manual

Reviewers: evan, spang, halla

Reviewed By: spang, halla

Differential Revision: https://phab.nylas.com/D3990
2017-02-21 12:26:58 -08:00
Juan Tejada 6dbbf1e094 [client-app] Measure and report times for removing labels from threads
Summary:
This commit adds new actions, `applyCategoryToThreads` and `removeCategoryFromThreads`
to be proxied and measured through the ThreadListActionsStore. These are called when
labels are added or removed via the category picker or by removing using
the label icon.

For now, we are only interested in timing actions that remove threads
from the inbox.

Test Plan: manual + reenabled unit tests for category-picker

Reviewers: spang, evan, halla

Reviewed By: halla

Differential Revision: https://phab.nylas.com/D3989
2017-02-21 12:13:17 -08:00
Juan Tejada fb85db0964 [client-app]: Measure and report time when dragging threads to sidebar
Summary:
This commit adds a new action, `moveThreadsToPerspective` to be proxied and
measured through the ThreadListActionsStore. This action is called when
a thread or group of threads is dragged and dropped into an item in the
sidebar.

For now, we are only interested in timing actions that remove threads
from the inbox

Depends on D3984

Test Plan: manual

Reviewers: halla, evan, spang

Reviewed By: evan, spang

Differential Revision: https://phab.nylas.com/D3985
2017-02-21 12:10:52 -08:00
Juan Tejada 90e49d31aa [client-app] Measure and report times for removing from inbox
Summary:
This commit adds a new action, `removeThreadsFromView` to be proxied and
measured through the ThreadListActionsStore

This action can encompass many different actions, e.g.:
- unstarring in starred view
- changing unread in unread view
- Moving to inbox from trash
- archiving a search result (which won't actually remove it from the thread-list)

However, for now, we are only interested in timing actions that remove threads
from the inbox

Depends on D3983

Test Plan: manual

Reviewers: halla, spang, evan

Reviewed By: spang, evan

Differential Revision: https://phab.nylas.com/D3984
2017-02-21 11:53:38 -08:00
Juan Tejada a8fbcb0c93 [client-app] Measure and report archiving times
Summary:
This commit makes so it we report perf metrics for archive actions.
To achieve this, I added a new `ThreadListActionsStore` which serves as
a proxy for thread actions, which allow us to time them.

The new store is in charge of listening to thread list actions, creating and
queueing  the appropriate tasks for any given action, and timing and
reporting action times to our MetricsReporter.

This commit only times archiving actions, and subsequent diffs will time
other relevant thread list actions.

Test Plan: manual

Reviewers: halla, spang, evan

Reviewed By: spang, evan

Differential Revision: https://phab.nylas.com/D3983
2017-02-21 11:50:55 -08:00
Juan Tejada 9f78574c3d [*] metrics(Part 6) MetricsReporter.reportEvent now requires a nylasId
Summary:
This will help us aggregate metrics by user. This also makes it so we
don't report events in dev mode

Test Plan: manual

Reviewers: spang, evan

Reviewed By: spang, evan

Differential Revision: https://phab.nylas.com/D3981
2017-02-21 11:48:45 -08:00
Juan Tejada 39c6c04bc4 [client-sync] metrics(Part 5) Rename PerformanceMonitor to GlobalTimer
Summary:
This global module wasn't really related to performance, but rather with
timing things across different processes in the app. I believe this name
is more appropriate.

Test Plan: I can still use NylasEnv.timer (instead of NylasEnv.perf)

Reviewers: spang, evan

Reviewed By: spang, evan

Differential Revision: https://phab.nylas.com/D3972
2017-02-21 11:47:33 -08:00
Juan Tejada 8afb14c4c6 [*] metrics(Part 4): Make /ingest-metrics use MetricsReporter
Summary:
This ensures that the Libhoney instance is a singleton in cloud
processes.

Test Plan: manual

Reviewers: mark, spang

Reviewed By: spang

Differential Revision: https://phab.nylas.com/D3969
2017-02-21 11:46:15 -08:00
Juan Tejada dc2f032325 [*] metrics(Part 3) Don't report CPU usage on every reportEvent
Summary: See title

Test Plan: Manual

Reviewers: spang

Reviewed By: spang

Differential Revision: https://phab.nylas.com/D3968
2017-02-21 11:45:29 -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
Evan Morikawa fd838a4280 [client-app] resolve symlinks before copying files
Summary:
In client-app/node_modules Lerna symlinks isomorphic-core to '../../'.
When we copy everything over to our tmp directory when building, we copy
over the relative symlink! Damn you lerna.

We get around this by resolving the symlinks BEFORE copying and caching
them in the installer task. Then the file copy always works.

Also, for some reason the glob {absolute} param doesn't seem to work in
the latest version. I'm manually creating an absolute path for the compile
target since it's a bit more transparent what's happening anyway.

Test Plan: `npm run build-client`

Reviewers: spang, jerm, juan, halla

Reviewed By: juan, halla

Differential Revision: https://phab.nylas.com/D3988
2017-02-21 14:36:18 -05:00
Evan Morikawa a7686bb35b [client-app] build tasks now use absolute paths
Summary:
Grunt is hardcoded to use paths relative to wherever the Gruntfile is
located. Unfortunately it also expects the grunt packages to be siblings
of that gruntfile. We can get around this by changing the relative base
path, but then the cwd is different for each tasks. This is okay as long
as we use absolute paths for various files in each of our tasks. This
updates our grunt tasks to use absolute paths

Test Plan: `npm run build-client`

Reviewers: spang, halla, jerm, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3987
2017-02-21 14:35:51 -05:00
Evan Morikawa 4582acc2e5 [client-app] actually npm install inside the /apm dir with env vars
Summary:
We weren't actually running npm install inside of apm. This meant that
/apm/node_modules was empty causing the build to fail. This will install
with the proper env required for old apm

Wow we need to get rid of this thing soon…

Test Plan: Run `npm install`

Reviewers: jerm, spang, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3986
2017-02-21 14:34:30 -05:00
Evan Morikawa 17b7653109 [dev, cloud-*] make Docker run plain npm install and conslidate deps
Summary:
It doesn't really make sense to have the root package.json have any
dependencies since it's never "packaged" or built itself. Everything
really should be a dev dependency. This was only separated before because
the Dockerfile unnecessarily added the --production flag.

This will make the docker build take a smidge longer, but I think it's
worth the extra minute to keep the dependencies orderly and sematically
correct

Test Plan: re-run docker build

Reviewers: jerm, spang, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3978
2017-02-21 14:33:00 -05:00
Juan Tejada 7fa5e2fb3f [client-sync] Make imap ended error retryable
Summary: This error should really be retryable, and will prevent more red boxes

Test Plan: manual

Reviewers: evan, spang

Reviewed By: evan, spang

Differential Revision: https://phab.nylas.com/D3982
2017-02-21 11:08:47 -08:00
Halla Moore d415e7792e [isomorphic-core] Ensure smtp config exists
Summary:
We previously weren't saving the smtp settings for cloud gmail accounts,
and even though we fixed that, we still need to be able to handle the accounts
that were authed before that fix went out. This diff changes `smtpConfig()` to
always call `credentialsForProvider` instead of depending on what was saved
in the database.

Test Plan: manual

Reviewers: juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D3980
2017-02-21 11:06:07 -08:00
Juan Tejada fad1671d6e [client-app] Fix delta-processor tests 2017-02-21 08:56:47 -08:00
Halla Moore a9f3033907 [cloud-workers, isomorphic-core] Implement the SendRemindersWorker
Summary:
Process reminders metadata and send the reminder email if there
haven't been any replies. Checking for replies involves checking
each of the folders in `folderImapNames` for messages that are in
reply to the messages in `messageIdHeaders`.

Test Plan: manual

Reviewers: khamidou, juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D3958
2017-02-17 19:08:20 -08:00
Halla Moore 1e0ae4fb03 [cloud-core, cloud-workers, isomorphic-core] Fix sending from cloud-workers
Summary:
The SendmailClient is in isomorphic-core, but wasn't working properly when
called from cloud-workers. This diff includes a variety of fixes to get it
working:

  - Add smtp config to connection settings in cloud-core
  - Don't use `PromiseUtils.promisify` for a function that needs `this` to
    be bound properly
  - Don't reference `NylasEnv` (That error gets caught and reported
    elsewhere anyway, we don't need to report it here)
  - Default `message.uploads` to `[]` to keep iterator happy
  - Add Gmail environment variables to cloud-worker app

Test Plan: manual

Reviewers: juan, khamidou, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D3954
2017-02-17 19:05:36 -08:00
Halla Moore 302f3b6215 [client-app, client-private-plugins] Update the reminders metadata structure
Summary:
The new send-reminders cloud-worker needs different information to check for
replies now that the sync engine is local. Make sure we save all of the
required information to the metadata. The current values are:

  - expiration: the time the reminder should be sent, if no new replies
  - folderImapNames: the folders to check for replies
  - messageIdHeaders: the Message-Id headers of messages in the thread
    (we search for In-Reply-To headers that match these values, and also
     use them to decide whether a message is a new reply or an old reply)
  - replyTo: the message to reply to when sending the reminder email
  - subject: the subject to use when sending the reminder email

Test Plan: manual

Reviewers: juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D3952
2017-02-17 19:03:07 -08:00
Evan Morikawa 12236753d5 [client-app] only show cloud deltas in the developer bar
Summary:
This removes client-sync deltas from the developerbar delta list.

We ONLY show cloud deltas now.

The connection between client-sync is no longer a network delta stream,
it's a direct function call. It makes no sense to show its status.

This now shows a single dot representing the state of the cloud delta
stream.

Test Plan: Manually connect and disconnect local cloud API and see icon change

Reviewers: halla, spang, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3977
2017-02-17 17:33:18 -08:00