Commit graph

2333 commits

Author SHA1 Message Date
Mark Hahnenberg 70a04aff19 [composer] Fix autoclearing of participants field in composer
Summary:
Occasionally, if the composer plugins took too long to load, the user would
start typing only to have their text blown away when the plugins finally came in.
This was caused by carelessly overwriting the TokenizingTextField's stored
inputValue state in componentWillReceiveProps. Now we don't do that!

Test Plan: Run locally, make sure things don't get blown away

Reviewers: evan, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3806
2017-01-30 13:44:27 -08:00
Evan Morikawa bf0aa51148 fix(rename): update nylas/N1 to nylas/nylas-mail Github references 2017-01-30 11:50:39 -08:00
Juan Tejada ab5e5af7a9 bump(k2) 2017-01-30 11:39:18 -08:00
Michael Grinich 05da3a6c0d Update documentation with GitBook 2017-01-30 02:38:37 -08:00
Juan Tejada c7037d06a1 bump(k2) 2017-01-28 01:40:18 -08:00
Evan Morikawa 9be018b489 bump(k2) 2017-01-27 17:49:38 -05:00
Evan Morikawa 667f4dd87d bump(k2) 2017-01-27 17:46:39 -05:00
Juan Tejada 82b3033861 fix(tasks) ChangeMailTask should depend on EnsureMessagesInSentFolder
Summary:
See title
Add specs

Test Plan: unit

Reviewers: halla, evan

Reviewed By: halla, evan

Differential Revision: https://phab.nylas.com/D3805
2017-01-27 14:02:50 -08:00
Juan Tejada 5b11097172 bump(k2) 2017-01-27 12:50:35 -08:00
Evan Morikawa 3441df3a65 bump(k2) 2017-01-27 14:19:48 -05:00
Juan Tejada 3aaf91ee93 bump(k2) 2017-01-27 08:29:27 -08:00
Evan Morikawa bb560af023 bump(changelog): 1.0.16 2017-01-27 10:11:09 -05:00
Juan Tejada f6193f9114 bump(k2) 2017-01-26 13:38:40 -08:00
Juan Tejada 6dc9bbf412 fix(tasks) Notify when actions on threads fail
Summary: It is better to notify that a task failed rather than having a thread or group of threads randomly bounce back.

Test Plan: manual

Reviewers: evan, spang, mark, halla

Reviewed By: mark, halla

Subscribers: mark

Differential Revision: https://phab.nylas.com/D3790
2017-01-26 13:30:40 -08:00
Juan Tejada 78cdf32761 bump(k2) 2017-01-26 09:19:42 -08:00
Juan Tejada c996af3b36 bump(k2) 2017-01-26 09:11:01 -08:00
Juan Tejada 54ca43e48e fix(plugins) Unbreak plugins support in Nylas Mail
Properly use plugins specified in babelrc.json when using the babel
compiler. #3187
2017-01-25 22:41:54 -08:00
Juan Tejada 0eaa184a4a bump(k2) 2017-01-25 16:37:54 -08:00
Juan Tejada 7beff5bae4 fix(onboarding) Allow users who only have custom imap to auth
Summary:
Users who only had a custom imap account could not open the window to
add a custom imap account the first time the auth was opened, rendering
the app useless for them.

Github issue #3185 and T7691

Test Plan: manual

Reviewers: halla, spang, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D3783
2017-01-25 15:06:58 -08:00
Mark Hahnenberg 7bf8d18a02 Don't register to receive IPC for hot windows
Summary:
These windows don't need to receive IPC until they're being used for something
(i.e. after transitioning from hot window to composer, popout, etc)

Test Plan:
Run locally w/ hot windows shown, make sure that hot window doesn't
receive IPC

Reviewers: evan, spang, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3780
2017-01-25 14:54:38 -08:00
Mark Hahnenberg 6946bda2bd Use meaningful names for helper processes
Summary: See diff title

Test Plan: Run locally, check in htop for new titles

Reviewers: evan, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3778
2017-01-25 14:54:13 -08:00
Evan Morikawa 14514a3413 fix(specs): change spec scheduler back to setTimeout
Summary:
Adds a new `npm run test-window` that will launch specs in a window so you
can use the debugger

The spec window wouldn't close because `onbeforeunload` was unnecessarily
preventing close. This circumvents this in spec mode.

Most significantly I discovered we can't use the synchronous timer for the
promise scheduler anymore. Suppose you do:

```
it('should error', async () => {
  try {
    await doSomething()
    throw new Error("doSomething should have thrown!")
  } catch (err) {
    expect(err.message).toMatch(/my message/)
  }
})
```

The way async/await is transpiled, when `doSomething` throws, the error
will propagate all the way back up to the uncaughtPromiseException handler
before the `catch` gets called and registered. The transpilation method
assumes that when the function gets executed it can synchrously advance
beyond the call before the `then` or `catch` resolve. When the promise
scheduler is synchronous this doesn't happen.

I chose to use `setTimeout` instead of `process.nextTick` or
`setImmediate` as the promise scheduler. `setTimeout` seems to work better
with Chrome's async function call stacks. `nextTick` and `setImmediate`,
being Node methods, skip Chrome's async watchers.

Test Plan:
I talked with Juan about these changes, in an upcoming diff he will be
testing these in the context of our broader test suite.

Reviewers: mark, khamidou, halla, spang, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3779
2017-01-25 17:43:11 -05:00
Evan Morikawa 2fe1368aa9 bump(k2) 2017-01-25 17:11:45 -05:00
Juan Tejada 85d41839c1 bump(k2) 2017-01-25 13:53:17 -08:00
Evan Morikawa 9b21dfb261 bump(k2) 2017-01-25 15:28:09 -05:00
Juan Tejada a4a71d790f bump(k2) 2017-01-25 10:57:16 -08:00
Mark Hahnenberg afb49b8b2f Add option to silence query plan debug output for individual queries
Summary:
Sometimes you have to perform a query that needs to do a table scan. For those
times you don't want to silence entire classes of queries (e.g. by table name),
you can now silence individual queries.

Test Plan: Run locally, verify that noisy stuff disappears from logs

Reviewers: evan, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3763
2017-01-25 09:56:46 -08:00
Evan Morikawa b5a6739bfb bump(k2) 2017-01-25 10:13:05 -05:00
Evan Morikawa 0be186302a refactor(account): remove unused accont refresh methods
Summary:
This removes `refreshHealthOfAccounts`, which I originally found because I
was trying to refactor it out of the IdentityStore. We need it gone from
the IdentityStore so that store can trigger frequently as things like the
usageLimits constantly update on it.

This also fixes T7520 where we'd get `ECONNREFUSED 127.0.0.1:2578` on
launch unnecessarily.

The concept of refreshing the health of accounts by occassionally polling
the /accounts endpoint is obsolete. This depends on
D3769 which entirely removes the /accounts endpoint
from K2.

Account health is pushed to us by `Actions.updateAccount` which is fired
directly from the main local-sync sync loop.

This also removes `refreshAccounts` and `Actions.refreshAllDeltaConnections`. These were fired by the Identity Store whenever it updated. We no longer need the Identity Store to tell us to reset the delta connections with our local-sync accounts. The delta connections will either be reset by our offline notification button, or when adding or removing an account. The Identity Store was a redundant mechanisms

Test Plan:
Manually verify things work with an existing account. Add a new account
and ensure sync starts. Remove an account and ensure it gets cleaned up.

Reviewers: halla, khamidou, mark, juan

Reviewed By: juan

Maniphest Tasks: T7520

Differential Revision: https://phab.nylas.com/D3770
2017-01-25 10:12:09 -05:00
Evan Morikawa f2517ea7d7 refactor(name): rename worker-sync package to deltas
Summary:
This diff is a rename. No logical changes.

We used to have a set of files called `nylas-sync-worker`. In Old N1 these
used to have a lot of logic to slowly sync mail from our API. Since we
exclusively use local-sync via a soon-to-be-obsolesced delta stream, these
files really just manage the delta streaming connection.

It's incredibly confusing to have a set of files called worker-sync when
there's a sync-worker already in the codebase. This renames everything to
refer to them as account sync workers.

The reason I wanted this rename is because the IdentityStore on initial
launch triggers and fires a fairly scary-sounding
`Actions.refreshAllSyncWorkers()`. In reality all it does is
`Actions.refreshAllDeltaConnections()`. I'm also tired of staring at files
for a full minute before realizing that this is not the sync worker I was
  looking for.

Test Plan:
After rename, booted the app and ensured that deltas were coming through
for new mail and no errors were being thrown

Reviewers: halla, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3767
2017-01-25 10:08:23 -05:00
Juan Tejada d644fe6396 bump(k2) 2017-01-24 17:43:34 -08:00
Halla Moore d3a0d60f0d fix(unpersistModel) Add default value for opts param
Just an empty object, so looking up a property on it doesn't error.
(Also some whitespace changes that automatically changed on save.)
2017-01-24 16:45:49 -08:00
Juan Tejada 5ed1f4da9e 🎨 Fix to using imap-provider-settings package
Summary: see title

Test Plan: manual

Reviewers: spang, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D3772
2017-01-24 16:25:03 -08:00
Christine Spang 7082ddeabf fix(updater): s/N1/Nylas Mail/ 2017-01-24 11:57:08 -08:00
Juan Tejada eecf19717a bump(k2) 2017-01-24 11:46:53 -08:00
Evan Morikawa a20b979208 feat(analytics): add analytics for change mail tasks
Summary:
Adds the following new events:

- Threads Moved to Folder
  - isArchive
  - source
  - folderType
  - folderDisplayName
  - numThreads
  - numMessages
  - description
  - isUndo

- Threads Changed Labels
  - isArchive
  - source
  - labelTypesToAdd
  - labelTypesToRemove
  - labelDisplayNamesToAdd
  - labelDisplayNamesToRemove
  - numThreads
  - numMessages
  - description
  - isUndo

- Threads Starred
  - source
  - numThreads
  - description
  - isUndo

- Threads Unstarred
  - source
  - numThreads
  - description
  - isUndo

- Threads Marked as Read
  - source
  - numThreads
  - description
  - isUndo

- Threads Marked as Unread
  - source
  - numThreads
  - description
  - isUndo

Each new action has a "source" property that's one of the following:
- Category Picker: New Category
- Category Picker: Existing Category
- Toolbar Button: Message List
- Toolbar Button: Thread List
- Send and Archive
- Context Menu: Thread List
- Thread List Icon
- Quick Actions: Thread List
- Swipe
- Keyboard Shortcut
- Dragged Out of List
- Snooze Move
- Important Icon
- Label Remove Icon
- Thread Selected
- Mail Rules
- Dragged Into List

Test Plan: manual

Reviewers: juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3760
2017-01-24 12:22:33 -05:00
Juan Tejada 0e19f4511e fix(auth): Properly wait for acct to be inited before adding to sidebar
Summary:
Previously, when adding an account, we waited for it to be completely loaded (which meant having fetched the folder list) before focusing it on the sidebar. This could take several seconds, so it made the app feel unresponsive or slow when adding an account.

Then, we changed the logic to wait an arbitrary amount of time to focus the newly added account in the sidebar, with the hope that it would be enough time to focus it correctly but that it wouldn't seem too long. This still caused the unwanted effect of focusing it before it had been fully loaded.

This commit changes the auth flow so that the onboarding shows a Success page until the newly added account is fully loaded, and only /then/ closes itself, focuses the main window, and allows the account to be correctly focused in the sidebar.

Test Plan: manual

Reviewers: halla, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D3751
2017-01-24 07:34:18 -08:00
Juan Tejada 3ca694fd30 fix(sync) Make category syncback tasks save changes after imap success
Summary:
This will solve T7579 for actions involving categories (folders/labels)
Depends on D3753

Test Plan: manual

Reviewers: halla, mark, khamidou, evan, spang

Reviewed By: evan, spang

Differential Revision: https://phab.nylas.com/D3754
2017-01-24 07:31:37 -08:00
Mark Hahnenberg 5730d23da8 [search-index] Limit search index size
Summary:
This diff modifies the SearchIndexer class to handle limiting the search
index size. It does this by periodically re-evaluating the window of
the n most recent items in a particular index where n is the max size of
the index. It then unindexes the items which are marked as indexed but
are no longer in the window and indexes the things that are in the window
but aren't marked as indexed.

Test Plan:
Run locally with a reduced thread index size, verify that the index
includes the most recent items and that it is the correct size. Also verify that
the queries used properly use fast sqlite indices.

Reviewers: evan, juan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D3741
2017-01-23 12:19:34 -08:00
Evan Morikawa 3710438296 bump(k2) 2017-01-23 15:02:17 -05:00
Mark Hahnenberg c7d8f1700d [thread-search] Background on-keypress search queries
Summary:
When the search index got very big the queries we were running during
after keypress would cause jank in the UI which was very noticeable on
subsequent keypresses. This diff backgrounds these queries and adds a
LIMIT to the fts MATCH clauses to avoid having to send too much stuff
across the IPC bridge.

Test Plan: Run locally, make sure that typing is smooth while searching

Reviewers: juan, evan

Reviewed By: juan, evan

Differential Revision: https://phab.nylas.com/D3757
2017-01-23 11:50:27 -08:00
Halla Moore 6e6bc1239f fix(unindexModel): Don't re-persist unpersisted models
Summary: See title

Test Plan: tested locally

Reviewers: juan, mark, evan

Reviewed By: juan, mark

Subscribers: juan

Differential Revision: https://phab.nylas.com/D3744
2017-01-23 11:32:46 -08:00
Juan Tejada a3f7300df9 fix(crash): Fix error reporting for unhandled promise rejections
When handling unhandled promise rejections, our error reporter would
completely freeze the worker window when trying to send a Promise
through the ipc bridge, rendering the app unusuable

This fixes T7621
2017-01-20 13:46:57 -08:00
Evan Morikawa ea5c9db46e bump(k2) 2017-01-20 10:25:15 -08:00
Juan Tejada 49bb85ff96 fix(auth) Don't show error message when auth is successful 2017-01-19 16:44:42 -08:00
Juan Tejada fc19cf03c3 bump k2 2017-01-19 11:25:43 -08:00
Juan Tejada 38ea173b2b fix(error-mgmt): Add a few improvements to error management
Summary:
- Add a new button to the sync error notification to "Debug" sync. This will open the activity window and dev tools in that window. Depends on D3736
- Update the "Contact Support" link in error notifications to prepopulate the support ticket with the sync error in the account
- Make the "Check Again" button react when clicking it

Test Plan: manual

Reviewers: evan, khamidou

Reviewed By: evan, khamidou

Differential Revision: https://phab.nylas.com/D3737
2017-01-19 10:53:04 -08:00
Evan Morikawa b9826d6685 bump(k2) 2017-01-19 10:46:33 -08:00
Mark Hahnenberg 157501130b [thread-search] Add loadFromColumn option to Attribute
Summary:
The isSearchIndexed attribute gets bulk reset when we drop the search
index, however, the JSON values were not updated to reflect the new
column values. We don't care about notifications to this field, so in
order to make bulk clearing ok this diff adds a new loadFromColumn option to
Attributes which causes the value to be loaded from the SQL table column
rather than the JSON blob.

Test Plan:
Run locally, drop the search index, make sure we load from the
column rather than the JSON when re-indexing

Reviewers: juan, evan

Reviewed By: juan, evan

Differential Revision: https://phab.nylas.com/D3739
2017-01-19 10:22:32 -08:00
Evan Morikawa 735c7faa73 fix(auth): Gmail auth screen now shows error states
Summary:
- Refactor Gmail auth functions
- Add Analytics in
- Show error states

Depends on D3735

Test Plan: manual

Reviewers: khamidou, juan

Reviewed By: khamidou, juan

Differential Revision: https://phab.nylas.com/D3732
2017-01-18 17:44:22 -08:00