Commit graph

5462 commits

Author SHA1 Message Date
Juan Tejada 72613baf5d [client-app] Fix selecting and creating signatures in preferences
Summary:
This commit fixes 2 issues with signatures in the preferences:
- Creating a signature (via any of the create buttons) would create 2 signatures
- Trying to select accounts to associate with a signature in the preferences would not work (the account would not be selected)

This was a regression introduced in e638e94084 (diff-4f38fd25aa24b48a309354be643165d3R26)

3111c16 made it so we attempt to `activate` any Stores that are registered with
the StoreRegistry. When adding stores to `nylas-exports`, they are
automatically registered in the StoreRegistry. Given that the
`SignatureStore` is in `nylas-exports`, and consequently is registered in
the StoreRegistry, it would be `activate`d upon window boot.

However, we were also manually activating it inside `internal_packages/composer-signatures/lib/main.es6`.
This caused it to register listeners for every action **twice**. For
this reason, 2 signatures would be created when trying to create 1, and
an account would be immediately unselected after being selected int he
signatures dropdown in preferences.

(Other changes in this are just stylistic)

Test Plan: manual

Reviewers: spang, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D4043
2017-02-28 09:14:28 -08:00
Juan Tejada de9484cc52 [client-sync] Fix missing pass in of syncWorker in EnsureMessageInSentFolder 2017-02-26 10:36:31 -08:00
Mark Hahnenberg 6bd6242398 [client-sync] Use IMAPConnectionPool in client sync worker
Summary: See title

Test Plan: Run locally, make sure sync still works

Reviewers: evan, spang, juan

Reviewed By: spang, juan

Differential Revision: https://phab.nylas.com/D3998
2017-02-24 13:09:32 -08:00
Christine Spang e991349708 [client-sync] Fix missing pass in of syncWorker to FetchNewMessagesInFolder 2017-02-24 12:49:37 -08:00
Evan Morikawa f23a96c481 [client-sync] limit attributes returned for messages
Summary:
I did a grep for `Message.find.*` to see if there were any other places
we could limit the attributes returned

There were.

This used to be INSANELY wasteful to return all bodies when we only needed
the ids.

Test Plan: Manually bootup app and ensure search still works

Reviewers: mark, juan, spang

Reviewed By: mark, juan, spang

Differential Revision: https://phab.nylas.com/D4042
2017-02-24 11:04:18 -08:00
Evan Morikawa c7bdb5804a [client-sync] fix unbouded query
Summary:
Fixes T7783

This unbounded query, plus a yet-to-be-diagnosed bug causing large numbers
of messages with no folderIds, led to frequent crashes of the worker
window at the end of every sync loop.

This took a fair amount to diagnose. Notes on that are here:
https://paper.dropbox.com/doc/Diagnosing-Crash-X329VTxevrqtIMESBtHNV

Huge thanks to @mark.

Test Plan: Reboot app with patch, no more crashes!

Reviewers: spang, halla, mark, juan

Reviewed By: mark, juan

Subscribers: mark

Maniphest Tasks: T7783

Differential Revision: https://phab.nylas.com/D4039
2017-02-24 10:58:21 -08:00
Christine Spang 15eac9c9db [client-sync] Parse comma-separated References properly
This goes against the spec, but we've seen emails which use comma-separated
References instead of space-separated references. This could cause threading
to break if the message with comma-separated references was a reply and
we hadn't yet synced the message directly in the In-Reply-To header.
2017-02-23 18:58:13 -08:00
Juan Tejada 5e35d39eb2 [client-app] Properly re-index threads when their data has changed
Summary:
When we detect that threads in the database have changed, if they've already
been indexed, mark them as unindexed so that the indexer picks them up and
re-indexes them with the updated data

Test Plan: manual

Reviewers: evan, spang, mark

Reviewed By: mark

Differential Revision: https://phab.nylas.com/D4023
2017-02-23 17:52:09 -08:00
Juan Tejada 93836f7973 [iso-core] Fix imap error detection/coercion (again)
Summary:
If for whatever reason we passed an error with a `source` property
we weren't accounting for in `convertIMAPError`, we would return an
`undefined` error. Bad!

Instead, just return the original error

Test Plan: manual

Reviewers: spang, halla, evan, mark

Reviewed By: evan, mark

Differential Revision: https://phab.nylas.com/D4037
2017-02-23 17:46:15 -08:00
Juan Tejada e6b35497b8 [client-app] When reporting search metrics, clip all times to a range
Summary:
When reporting different times to mixpanel other than `actionTimeMs` via
recordPerfMetric, we also want to clip those times to a range to have
good data in mixpanel

This commit adds an extra option to recordPerfMetrics to be able to clip
data other than the default `actionTimeMs`, and uses the new option to
report search metrics

Test Plan: manual

Reviewers: spang, evan, halla, mark

Reviewed By: mark

Differential Revision: https://phab.nylas.com/D4038
2017-02-23 17:42:27 -08:00
Juan Tejada f1ed46d144 [client-app] Sample metrics reporting of actions we're keeping track of
Summary:
I'm making these up based on gut feeling, so feel free to completely change
these.

Test Plan: manual

Reviewers: spang, mark, evan

Reviewed By: mark, evan

Differential Revision: https://phab.nylas.com/D4026
2017-02-23 17:40:22 -08:00
Juan Tejada 49586e2e06 [client-app] Fix passing in nylasId and accountId to report metrics
Summary: This was really broken

Test Plan: manual

Reviewers: halla, mark, evan

Reviewed By: mark, evan

Differential Revision: https://phab.nylas.com/D4021
2017-02-23 16:35:33 -08:00
Juan Tejada ad1a192b53 [client-app] Report source when reporting open times for accts window
Summary: See title

Test Plan: manual

Reviewers: mark, halla, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D4020
2017-02-23 16:17:50 -08:00
Juan Tejada aeddc92e8e [client-app] Measure and report search perf metrics
Summary: See title

Test Plan: manual

Reviewers: evan, spang, halla, mark

Reviewed By: mark

Differential Revision: https://phab.nylas.com/D4019
2017-02-23 16:02:22 -08:00
Juan Tejada 7cd5128db4 [client-app] Measure and report app boot time
Summary: See title

Test Plan: manual

Reviewers: spang, mark, evan, halla

Reviewed By: mark, evan, halla

Differential Revision: https://phab.nylas.com/D4018
2017-02-23 16:01:07 -08:00
Christine Spang 49103367c1 [client-sync] Update comment about Gmail inbox prioritization 2017-02-23 15:36:35 -08:00
Christine Spang 4a1dde8830 [client-sync] Deduplicate UID downloads across sync loop interruptions
Summary:
Since we only persist updates to fetchedmin/fetchedmax at the end of a
batch, and a batch can contain many messages, if the sync loop is
getting interrupted often we will download the same messages over and
over again and not make much progress in downloading the message
backlog. This patch keeps a set of already downloaded messages in memory
for each batch and skips downloading UIDs we've processed in interrupted
sync loops.

Messages may still be redownloaded across app restarts.

Fixes T7798

Test Plan: manual

Reviewers: juan, mark

Reviewed By: juan, mark

Maniphest Tasks: T7798

Differential Revision: https://phab.nylas.com/D4040
2017-02-23 15:23:28 -08:00
Mark Hahnenberg da6bc473f8 [client-app] Limit search to focused perspective
Summary:
Previously we would always search all mail. Now, if the user has focused
a particular folder we will limit our search to that folder. The inbox
is an exception--it will always search all mail unless the user
explicitly uses an "in:" clause.

Test Plan: Run locally, verify that searching folders returns the correct results.

Reviewers: evan, spang, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4032
2017-02-23 13:36:45 -08:00
Juan Tejada dd1f19f62e [*] Update gitignore 2017-02-23 12:12:13 -08:00
Juan Tejada 95766e990a [cloud-api] DONT Timeout streaming API connections every 15 minutes anymore
This is a temporary commit to prevent connections from being closed
while we release logic to re-establish delta connections after they are closed.

Our infrastructure should be able to support current usage of delta
connections after our fixes to offline notification and infrastructure

This reverts commit 78f67d4a76.
2017-02-23 11:56:31 -08:00
Juan Tejada 18bf86769d [client-app] Update changelog 2017-02-23 10:52:14 -08:00
Juan Tejada dced0aa99e [client-sync] 🎨 Remove unecessary use of PromiseUtils
Given that this packages lives inside the NylasMail app, it has access
to Bluebird Promises, which already define a .each method.

Using PromiseUtils here is unecessary
2017-02-22 18:30:34 -08:00
Juan Tejada b96300f000 [iso-core] Fix imap error detection!
Summary:
We were only detecting and classifying IMAP errors as retryable and non
retryable in a few places, but errors thrown in any of our imap
operations were not being properly passed through our `convertImapErrors` :(

This was broken, oh so broken

Also loosen condition to detect System Errors

Test Plan: manual

Reviewers: spang, mark, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D4022
2017-02-22 17:51:56 -08:00
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