Commit graph

1976 commits

Author SHA1 Message Date
Halla Moore 4fd9967ffa 💄(account-onboarding): Fix margins on the accounts list 2017-01-14 10:44:26 -08:00
Evan Morikawa 5ab0173e78 fix(reset): fix the account reset button for K2
Summary: Depends on D3672

Test Plan: manual

Reviewers: mark, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3673
2017-01-13 19:00:01 -08:00
Evan Morikawa fcfae5d490 Fix references for ~/.nylas to ~/.nylas-mail
Summary: Fix references to nylas-mail

Test Plan: manual

Reviewers: jackie, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3674
2017-01-13 18:54:37 -08:00
Halla Moore 7f956af798 fix(task-labels): Remove ellipses from hardcoded labels and fix css class
The css class was accidentally renamed in another commit. Bring it back and
remove the hard-coded ellipses, since the ellipsis is now part of a css
psuedo element.
2017-01-13 13:42:43 -08:00
Evan Morikawa 45848ce3a0 fix(config): move from ~/.nylas-k2 to ~/.nylas-mail
Summary:
fix(config): move from ~/.nylas-k2 to ~/.nylas-mail

fix(auth): ignore onboarding urls that aren't Nylas

feat(sig): change default signature

bump(k2)

Test Plan: manual

Reviewers: halla, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3664
2017-01-13 12:19:42 -08:00
Halla Moore fc43bc834a fix(initial-sync-status): Change how we display the sync status
Summary:
This diff takes out the progress bars, since they can appear to
not move for very large mailboxes. Instead, just show an icon that
indicates whether the sync is complete or in progress, and add a
tooltip that displays how far back the folder has been synced to.

Submodule commit is D3662

Test Plan: tested locally

Reviewers: evan, juan

Reviewed By: evan, juan

Differential Revision: https://phab.nylas.com/D3663
2017-01-13 12:07:54 -08:00
Mark Hahnenberg ee438c7219 [thread-search] Add support for category search (i.e. "in:foo")
Summary: See title

Test Plan: Run locally, search for specific labels

Reviewers: evan, juan

Reviewed By: evan, juan

Differential Revision: https://phab.nylas.com/D3656
2017-01-13 11:53:41 -08:00
Karim Hamidou b880ee981d [feat] [autoupdater] Introduce a new channel, "Nylas Mail" + let N1
specify a preferred channel.
2017-01-13 10:59:12 -08:00
Jackie Luo 78a7388318 🎨(rename): Update Nylas N1 to Nylas Mail
Test Plan: Tested locally.

Reviewers: halla, juan, evan

Reviewed By: juan, evan

Differential Revision: https://phab.nylas.com/D3645
2017-01-12 12:05:44 -08:00
Halla Moore 99e3f732d9 fix(custom-imap): Hide custom imap accounts and settings from onboarding
Summary:
IMAP no longer appears on the onboarding account list, and the option to
edit connection settings does not appear for any of the visible account
types. Custom IMAP accounts can still be added via a menu option.

Fixes T7474

Test Plan: tested locally

Reviewers: juan, jackie, evan

Reviewed By: evan

Maniphest Tasks: T7474

Differential Revision: https://phab.nylas.com/D3636
2017-01-12 10:25:33 -08:00
Juan Tejada c40ba0a7f6 fix(notifs) Restore offline notification
Summary: See title

Test Plan: tested locally

Reviewers: evan, halla, jackie

Reviewed By: jackie

Differential Revision: https://phab.nylas.com/D3643
2017-01-11 17:26:27 -08:00
Halla Moore 0b8e8fa6d9 💄(initial-sync): Move "hide" to the top of the expanded progress
Summary: Fixes T7442

Test Plan: tested locally

Reviewers: evan, jackie

Reviewed By: jackie

Maniphest Tasks: T7442

Differential Revision: https://phab.nylas.com/D3640
2017-01-11 15:24:18 -08:00
Mark Hahnenberg 668c2935c9 [thread-search] Improve local thread search
Summary:
Previously we waited to build the local ThreadSearch index until we were
done with the initial mail sync. This is undesirable because inboxes can
be very large, making local sync useless for a number of hours after a
user adds an account. This diff removes that restriction.

This diff also adds a new rudimentary new grammar (along with accompanying lexer
and parser) for local thread search queries. This grammar is then
translated into the appropriate SQL queries on the ThreadSearch index
table. More advanced features (e.g. in:category, date ranges, etc) can be added
easily in the future by augmenting this simple search query language.

Test Plan: Run locally, new unit tests

Reviewers: juan, evan, khamidou

Reviewed By: khamidou

Differential Revision: https://phab.nylas.com/D3614
2017-01-11 14:26:42 -08:00
Halla Moore 49e4db69e3 feat(onboarding): Display a possible issue when credentials are incorrect
Summary:
When a user tries connecting an account and it 401's, show a note
that suggests what the issue may be, and link to a support article
for more information. In general, mention that they may need to use
an app password. If it's a Yahoo email address, ask if they've already
enabled the proper setting from within Yahoo.

Test Plan: tested locally

Reviewers: evan, jackie

Reviewed By: jackie

Differential Revision: https://phab.nylas.com/D3630
2017-01-11 11:19:38 -08:00
Halla Moore bd842ee73a fix(preference-accounts): Don't select accounts that no longer exist
Summary:
After updating an account's connection settings, there's a brief
moment where the selected account isn't null, but doesn't actually
exist in the AccountStore. This throws a bunch of undefined errors,
so this diff makes sure we discard that selection.

Fixes T7452

Test Plan: tested locally

Reviewers: evan, juan

Reviewed By: juan

Maniphest Tasks: T7452

Differential Revision: https://phab.nylas.com/D3634
2017-01-11 11:19:00 -08:00
Jackie Luo 3a6a4299af feat(onboarding): Add Yahoo and iCloud and fix styling 2017-01-10 18:14:56 -08:00
Halla Moore 2f2cf5be4e fix(onboarding): Don't store type-specific fields when switching account types
Summary:
Since we pass all of the account info to the type-specific auth routes, having
extra fields in the account info object can cause the auth request to fail its
validation. This diff ensures that switching account types will drop any fields
in the account info object that aren't accepted across all routes.

Fixes T7455

Test Plan: tested locally

Reviewers: evan, juan

Reviewed By: juan

Maniphest Tasks: T7455

Differential Revision: https://phab.nylas.com/D3633
2017-01-10 17:34:57 -08:00
Halla Moore f7691ff175 fix(category-picker): Handle the case where new category creation fails
Summary:
Instead of throwing vague undefined errors in the console, recognize that
they category wasn't created and notify the user via a dialog box.

Test Plan: Tested locally

Reviewers: jackie, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3632
2017-01-10 16:23:53 -08:00
Halla Moore c9d106f802 fix(connection-settings): Update connection settings for fastmail.com
Summary: The previous settings didn't support all operations. Fixes T7450 and T7451.

Test Plan: tested locally

Reviewers: juan

Reviewed By: juan

Maniphest Tasks: T7450, T7451

Differential Revision: https://phab.nylas.com/D3626
2017-01-10 11:22:23 -08:00
Karim Hamidou 141dd39c13 Create a wrapper around legacy N1 APIs.
Conflicts:
	src/K2
2017-01-09 15:18:43 -08:00
Halla Moore 08a0883d21 fix(spinner): Use a constant spinner when loading inline images
Summary:
We used to use a progress-based spinner, but we never get any progress
updates while downloading files, so the spinner was always at 0 and
never visible.

The submodule-commit is D3609, which adds support for inline images

Test Plan: tested locally

Reviewers: evan, spang

Reviewed By: spang

Differential Revision: https://phab.nylas.com/D3610
2017-01-09 10:46:09 -08:00
Evan Morikawa df1343da37 feat(off): disable/hide snooze, mail rules, misc minor plugins 2017-01-06 15:39:09 -08:00
Jackie Luo c0596ef8e4 fix(category-picker): Hide starred label 2017-01-06 13:18:51 -08:00
Tomasz Finc 7cc1666279 fix(Linting errors)
Summary: Second attempt at not linting the error logger and tiny lint cleanup

Test Plan: run the build

Reviewers: evan, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3591
2017-01-05 14:39:25 -08:00
Mark Hahnenberg f3caf0b561 [thread-search] Fix archiving from search perspective
Summary:
We weren't removing the inbox category in the search perspective, so
things weren't actually being archived.

Test Plan: Run locally

Reviewers: juan, evan

Reviewed By: evan

Maniphest Tasks: T7389

Differential Revision: https://phab.nylas.com/D3575
2017-01-04 11:15:45 -08:00
Halla Moore 9e2f14513e feat(sync-status): Add messaging in other areas when syncing
Summary:
We want users to know that their account is still syncing if they're
looking for a message and end up at the bottom of a thread list.
This diff changes some of the wording around the messaging when
sync isn't complete and also adds a footer at the bottom of the
syncing thread lists. Additionally, we added a "Show Progress"
link that will expand the sync details in the lower left.

Addresses T7354

Test Plan: tested locally

Reviewers: juan, evan, jackie

Reviewed By: jackie

Differential Revision: https://phab.nylas.com/D3551
2017-01-03 13:27:15 -08:00
Christine Spang b1aeefe433 fix(sync-worker): Don't call _determineWorkerPool() twice
A race condition on bootup was causing us to sometimes start
two delta sync workers for the same account.
2016-12-22 12:43:45 -08:00
Evan Morikawa 083021d860 perf(delta): replaces API delta stream with direct in-memory one
Summary:
This replaces the API delta stream with a direct in-memory one

Depends on D3548

Test Plan: manual

Reviewers: halla, jackie

Reviewed By: halla, jackie

Subscribers: juan

Differential Revision: https://phab.nylas.com/D3549
2016-12-21 18:44:17 -08:00
Juan Tejada a0050a22d5 fix(sync-status):Use weighted percentage avg for sync status progress bar
Summary: Also move calculation to sync store, rename stuff a little bit

Test Plan: Manual :(

Reviewers: evan, jackie, halla

Reviewed By: jackie

Differential Revision: https://phab.nylas.com/D3547
2016-12-21 18:30:54 -05:00
Jackie Luo b5970e1e46 fix(initial-sync-activity): Update correct function name 2016-12-21 12:04:50 -08:00
Juan Tejada b29f46fdae fix(auth): Fix authentication notifications
Summary:
Depends on D3544 (K2 diff)

This commit ensures that auth notifications are showed when the
underlying sync worker fails and are cleared when an account is
successfully reconnected

To achieve this, we manually keep track and update syncStates where
appropriate via `Actions.updateAccount`, given that we have access to
N1's version of the account directly from local-sync.
Initially I was considering account delta stream to the cloud-api and the local-api, but that
just complicated things more than it helped.

This commit also fixes a bug with refreshing the gmail token in which we
we were only attempting a token refresh upon restarting the app

This addresses: T7346, T7305, T7335

Test Plan: Manual

Reviewers: halla, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D3545
2016-12-21 07:23:09 -05:00
Halla Moore 78d1b85c7f re-feat(initial-sync-status): Bring the intiial sync progress bar back
Summary:
Adds a UI component to see the progress of initial sync.
(The behavior is sometimes a little strange, but I believe this is
just because of weird behavior in the NylasSyncStatusStore itself.
For instance, it sometimes never populates the `folderSyncProgress`
fields, or it never sets the progress to 1, so the bar stops at 99%)

Test Plan: tested locally

Reviewers: juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D3536
2016-12-19 12:40:36 -08:00
Evan Morikawa bbaf4590af feat(auth): update onboarding helpers to be async 2016-12-18 23:38:34 -05:00
Evan Morikawa 31a8fb2b5b feat(auth): add office 365 support
Summary: Adds a new button in auth for native Office 365 support

Test Plan: manual

Reviewers: jackie, halla, mark, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3532
2016-12-16 16:53:46 -05:00
Karim Hamidou cb6f761df3 Required changes for refreshing access tokens. 2016-12-16 11:10:20 -08:00
Halla Moore d03049b403 fix(mail-rules): use the right field name to get an account id
Summary:
With the fix to the delta-processor, this is all that's needed to
get mail rules working! Some places were trying to use 'accountId'
to access an account object's id, but it needs to be 'id' instead.

Test Plan: tested locally

Reviewers: jackie

Reviewed By: jackie

Differential Revision: https://phab.nylas.com/D3525
2016-12-15 14:18:50 -08:00
Evan Morikawa 99b428f90c fix(import): require 'rx' from 'nylas-exports' 2016-12-15 15:32:47 -05:00
Halla Moore 9066078911 fix(delta-processor): Return created models in the expected format
Summary:
We were returning an array of arrays, when really we wanted an object
of arrays keyed by model type. This also involved removing an implementation
of mapObject that was overwriting underscore's implementation of it.

Test Plan: local, having others try it.

Reviewers: juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3509
2016-12-15 12:12:37 -08:00
Juan Tejada 9039c49dba fix(send/tasks): Fix deltas for SyncbackRequest SyncbackTaskAPIRequest
Summary:
This commit fixes processing deltas for `ProviderSyncbackRequests` and
resolution of the `SyncbackTaskAPIRequest`

Specifically:
- Fix and update field definitions for `ProviderSyncbackRequest`
- Correctly parse the error attached to any `ProviderSyncbackRequest`
- Correctly process deltas for `ProviderSyncbackRequests` inside the
delta-processor
- Fix any tasks that used `SyncbackTaskAPIRequest`, and update send to use those

Depends on D3510

Test Plan: Todo/Manual

Reviewers: jackie, halla, evan

Reviewed By: halla, evan

Differential Revision: https://phab.nylas.com/D3511
2016-12-15 11:57:14 -08:00
Juan Tejada d92506d8f1 fix(sync-status): Change old per model status, in favor of per folder
Summary:
Addresses T7275
Previously, we kept track of the sync status of each API model, and the progress
we'd made syncing all available models (e.g. all threads, messages, events, etc)

Given K2's set up, we are now keeping track of sync status per folder, i.e. what
percent of the folder's messages we've synced. This status is now reported from K2
to N1 via folder object deltas, and this commit rewrites the
NylasSyncStatusStore (in ES6) to reflect that.

The new Store keeps the sync state per account, which is the merged state of
per folder sync state, and delta connections state.
We also got rid of `CategoryStore.whenCategoriesReady` in favor of
`whenCategoryListSynced`, which is derived from the fact hat as long as we've
started syncing one folder, we've already synced the entire list of of folders/labels.

There are a couple of TODOs to be addressed in upcoming diffs:
- T7329 Restore the sidebar component to show sync progress, which was previously removed
- T7330 Figure out how to report sync progress per label, specifically, we are interested in knowing how much of the inbox we've synced, which is a label in Gmail. (This might be a non-issue if we sync the inbox very fast, first)

Depends on D3514

Test Plan: Manual

Reviewers: mark, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D3515
2016-12-15 11:17:20 -08:00
Evan Morikawa d1c587a01c fix(spec): add support for async specs and disable misbehaving ones
More spec fixes

replace process.nextTick with setTimeout(fn, 0) for specs

Also added an unspy in the afterEach

Temporarily disable specs

fix(spec): start fixing specs

Summary:
This is the WIP fix to our spec runner.

Several tests have been completely commented out that will require
substantially more work to fix. These have been added to our sprint
backlog.

Other tests have been fixed to update to new APIs or to deal with genuine
bugs that were introduced without our knowing!

The most common non-trivial change relates to observing the `NylasAPI` and
`NylasAPIRequest`. We used to observe the arguments to `makeRequest`.
Unfortunately `NylasAPIRequest.run` is argumentless. Instead you can do:
`NylasAPIRequest.prototype.run.mostRecentCall.object.options` to get the
`options` passed into the object. the `.object` property grabs the context
of the spy when it was last called.

Fixing these tests uncovered several concerning issues with our test
runner. I spent a while tracking down why our participant-text-field-spec
was failling every so often. I chose that spec because it was the first
spec to likely fail, thereby requiring looking at the least number of
preceding files. I tried binary searching, turning on and off, several
files beforehand only to realize that the failure rate was not determined
by a particular preceding test, but rather the existing and quantity of
preceding tests, AND the number of console.log statements I had. There is
some processor-dependent race condition going on that needs further
investigation.

I also discovered an issue with the file-download-spec. We were getting
errors about it accessing a file, which was very suspicious given the code
stubs out all fs access. This was caused due to a spec that called an
async function outside ot a `waitsForPromise` block or a `waitsFor` block.
The test completed, the spies were cleaned up, but the downstream async
chain was still running. By the time the async chain finished the runner
was already working on the next spec and the spies had been restored
(causing the real fs access to run).

Juan had an idea to kill the specs once one fails to prevent cascading
failures. I'll implement this in the next diff update

Test Plan: npm test

Reviewers: juan, halla, jackie

Differential Revision: https://phab.nylas.com/D3501

Disable other specs

Disable more broken specs

All specs turned off till passing state

Use async-safe versions of spec functions

Add async test spec

Remove unused package code

Remove canary spec
2016-12-15 13:02:00 -05:00
Halla Moore ace6cf4c9e feat(showDetails): Allow a "Show Details" option on error dialogs
Summary:
Pass in more details on sending errors, so that they can be viewed
more easily by clicking "Show Details", rather than having to check
the worker window console.

Test Plan: tested locally

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D3505
2016-12-14 13:02:18 -08:00
Evan Morikawa 476bbb0e5f feat(auth): add better error state handling 2016-12-07 10:11:22 -08:00
Evan Morikawa f170d14b8d fix(errors): properly rethrow api error 2016-12-06 17:21:37 -08:00
Evan Morikawa e595590a9a refactor(auth): DRY auth 2016-12-06 16:03:42 -08:00
Juan Tejada 68e596bdf4 [local-sync] Correctly sync folders and labels
This commit will correctly keep track of folder and label ids when
creating them from N1.

Previously, when we sent the request to create a folder or label to our api,
we would immediately get back a serverId because it was created optimistically
in the back end— given that K2 is strictly non-optimistic, we won’t have a serverId
until some undetermined time in the future, and we need to somehow reference
the object that /was/ optimistically created in N1 to update the ui when
we do get the server id.

Since we can deterministically generate ids for folders and labels,
we "guess" what its going to be, and include it in the props of the syncback request
returned to N1. This is the simplest solution to get thing working
correctly right now, but we’ll need to revisit this in the future for
other types of objects (drafts, contacts, events), and revisit how we
will manage optimistic updates in N1 when we merge the 2 codebases
with K2 (given that K2 was designed to be non-optimisitc).
2016-12-05 18:57:13 -08:00
Ben Gotow b0b231094d fix(deltas): Minor tweaks to metadata delta processing 2016-12-05 10:19:37 -08:00
Ben Gotow a9ccd7370c fix(deltas): Minor adjustments for thread deltas 2016-12-02 15:59:05 -08:00
Jackie Luo ad5a1a6316 refactor(nylas-api): Make requests with helpers 2016-12-02 15:51:38 -08:00
Ben Gotow 0e8829b929 fix linter errors 2016-12-02 15:44:52 -08:00