Commit graph

5384 commits

Author SHA1 Message Date
Evan Morikawa 9994b2b3d7 [client-app] remove rouge-committed packages folder 2017-02-17 15:08:26 -08:00
Halla Moore 57ff111925 [client-app, client-sync] Save imap folder names in the client-app
Summary:
Client-sync has the full imap folder names, but used to only pass the display
name to the application. The application needs the full imap names so that it
can pass them via metadata to cloud-workers that need to open imap boxes.

Test Plan: manual

Reviewers: evan, juan

Reviewed By: evan, juan

Subscribers: juan

Differential Revision: https://phab.nylas.com/D3951
2017-02-17 14:47:10 -08:00
Halla Moore 393474a4d8 [isomorphic-core] Allow use of atob() in cloud environments
Summary: atob() is a global in browser environments, but needs to be imported otherwise.

Test Plan: manual

Reviewers: juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3950
2017-02-17 14:46:07 -08:00
Evan Morikawa ad65b7d77a [client-app] convert FocusedContactStore to es6 2017-02-17 14:17:30 -08:00
Mark Hahnenberg ebb19b4cd8 [client-app] Fix stale import
Summary: Moved a file and forgot to update this import :-/

Test Plan: Run locally

Reviewers: juan, evan, spang

Differential Revision: https://phab.nylas.com/D3970
2017-02-17 14:14:17 -08:00
Christine Spang faf44193a7 [local-sync] Differentiate sync loop & other errors by additional fingerprint info
Summary:
If an exception has the same stack trace, by default Sentry will always group
it together in the same event. We don't want to do that for sync loop
errors---e.g. 'Invalid credentials' errors should not be grouped together with
stuff like 'Too many simultaneous connections'. Creating more unique groups
will allow us to better evaluate the effect of sync & other bugfixes.

Test Plan: writing unit test right now

Reviewers: juan, mark

Subscribers:

Differential Revision: https://phab.nylas.com/D3915
2017-02-17 14:03:24 -08:00
Mark Hahnenberg 00299e446d [message-list] Add support for double-clicking inline images to open
Summary: See title

Test Plan: Run locally, verify that double clicking inline images opens them

Reviewers: evan, juan, spang

Reviewed By: juan, spang

Differential Revision: https://phab.nylas.com/D3963
2017-02-17 14:01:07 -08:00
Christine Spang 9cf703c6cd [*] Clean up some cruft
Summary: This stuff doesn't seem to be used for anything anymore and it's cluttering up the client-app dir.

Test Plan: ran the app, also did `npm start` with no ~/.nylas-dev

Reviewers: evan, juan

Reviewed By: evan, juan

Differential Revision: https://phab.nylas.com/D3961
2017-02-17 13:51:27 -08:00
Juan Tejada 4d5e69da7d [*] metrics(Part 1) Add env-helpers to iso core
Summary:
This is a set of functions which will allow isomorphic-core to detect
which environment it is running on.

This will be useful for moving the metrics reporter to iso-core

Test Plan: manual

Reviewers: mark, spang

Reviewed By: spang

Differential Revision: https://phab.nylas.com/D3966
2017-02-17 13:34:07 -08:00
Mark Hahnenberg a95ca8b07a [*] Fix electron launch args
Summary:
We were doing some incorrect processing of args passed to the main
function which was causing us to think we were launching NM by passing a
file (which creates a new draft and tries to attach that file). Since
were trying to attach 'packages/client-app', this was causing an error
dialogue to appear indicating that it wasn't possible to attach a
directory.

Test Plan: Run locally, verify no dialogue

Reviewers: evan, spang, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3962
2017-02-17 13:03:20 -08:00
Evan Morikawa c4a26e1dcd [*] convert everyting to rx-lite 2017-02-17 12:15:23 -08:00
Evan Morikawa 425fbdf0ca [cloud-*] fix Dockerfile to correctly use postinstall script 2017-02-17 12:15:23 -08:00
Juan Tejada c8a299ed9b [*] Correctly copy error logger extensions in postinstall script
Summary: Also fix linter errors

Test Plan: manual

Reviewers: evan, mark, halla

Reviewed By: halla

Subscribers: halla

Differential Revision: https://phab.nylas.com/D3960
2017-02-17 12:12:56 -08:00
Evan Morikawa b686b969cd [cloud-*] Get cloud-api and cloud-workers running on new repo
[dev] remove .tern-project

[cloud-*] move into cloud-core/build

[cloud-core] convert to launch properly via Docker
2017-02-17 11:47:45 -08:00
Mark Hahnenberg 8267a14966 [iso-core] Add BackoffScheduler to exports
Summary: See title

Test Plan: Make sure NM loads

Reviewers: evan, spang, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3959
2017-02-17 11:03:26 -08:00
Juan Tejada 5a3a105e9d [*] Move BackoffSchedulers into isomorphic-core 2017-02-17 10:11:35 -08:00
Juan Tejada d385350808 [client-app] Update changelog 2017-02-17 10:11:35 -08:00
Evan Morikawa 3113fba25b [client-app] fix module spec
This changed because we now globally require node_modules
2017-02-17 10:00:43 -08:00
Evan Morikawa 918fa0b6dd [*] move to monorepo
[*] update babel

[client-app] remove flow-typed

[client-app] Move build/package.json to main package.json

[client-app] remove spec_integration

[client-app] fix babel support

Add client-private-plugins package.json

[client-app] add node_modules to global path for private-plugins

Move client-sync dependencies to client-app root

fix electron rebuild

[*] moved to monorepo

Summary: App now runs in monorepo

Test Plan: npm test

Reviewers: juan, mark, khamidou, halla, spang

Differential Revision: https://phab.nylas.com/D3947
2017-02-16 18:46:26 -08:00
Jeremy Price f66bd8643b [n1cloud][docker][logs] added pm2 wrapper for logs
Launching pm2 via a wrapper that launches pm2 as a daemon in the background
and then runs pm2 logs --raw in the foreground. This gets us the logs that
we want without the additional cruft that pm2 outputs by default
2017-02-16 17:29:59 -08:00
Christine Spang 25d88589ba fix(linux-build): Update rpm spec to use new package name 2017-02-16 16:58:27 -08:00
Christine Spang 2bc6b7ac0f fix(linux-build): Change package name to Nylas Mail
Need this in order to allow parallel installation of Nylas Pro and Nylas
Mail.
2017-02-16 16:07:36 -08:00
Christine Spang 15697a9064 fix(cli): s/n1/nylas-mail/ 2017-02-16 16:02:08 -08:00
Juan Tejada 3978ee0dd0 Update .arcconfig to point to new repo
Summary: see title

Test Plan: manual

Reviewers: spang

Reviewed By: spang

Differential Revision: https://phab.nylas.com/D3945
2017-02-16 14:15:19 -08:00
Evan Morikawa 9407533f51 [client-*] Rename packages folders and update readme 2017-02-16 13:31:37 -08:00
Evan Morikawa 84e2c75ce9 Merge remote-tracking branch 'k2/master' 2017-02-16 13:20:20 -08:00
Evan Morikawa 9f6889b03f [nylas-mail] move nylas-mail into /packages 2017-02-16 13:15:10 -08:00
Evan Morikawa ebac4275cb fix(SFDC): fix React error in tokenizing text field
Summary:
Get ready for some SFDC diffs! Hooray getting more eyeballs on SFDC. At
this stage it's a lot of FYI to hopefully start showing more people parts
of the SFDC plugin.

This is related to the form you use to create new Salesforce Objects with.

The form window basically looks like:
```
<SalesforceObjectFormWithWindowProps>
  <SalesforceObjectForm>
    <GeneratedForm>
      <GeneratedFieldset>
        <FormItem type="input" />
        <FormItem type="email" />
        ... (lots of FormItems)
        <SalesforceObjectPicker>
          <TokenizingTextField>
            <Menu>
              some placeholder that had an error fixed by this diff!!!
            </Menu>
          </TokenizingTextField>
        </SalesforceObjectPicker>
        <FormItem type="checkbox" />
      </GeneratedFieldset>
    </GeneratedForm>
  </SalesforceObjectForm>
</SalesforceObjectFormWithWindowProps>
```

The whole GeneratedForm is controlled by an obejct called `formData`. This
is documented in `GeneratedForm`.

This bug prevented me from properly using SalesforceObjectPickers inside
my form.

Test Plan: manual

Reviewers: mark, halla, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3935
2017-02-16 12:36:06 -08:00
Evan Morikawa 41bc1e5f5c [local-sync] fix related threads
Summary:
When saving a thread, we weren't properly setting the `participants`
object. Since Sequelize has object properties under getters and setters,
doing `this.participants.push()` did nothing.

Since threads had no `participants`, the related threads widget, which
queries through there, did nothing.

Test Plan: Manually inspect DB and use the related threads widget

Reviewers: halla, spang, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3938
2017-02-16 12:33:52 -08:00
Evan Morikawa 9932fa4882 [*] update package.json to lerna specs
Summary:
This is the result of auto package.json fixing by lerna. Would be nice to
commit this so you can run script/bootstrap without it making local
changes.

I didn't manually bump any versions.

Test Plan: manual

Reviewers: mark, halla, spang, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3934
2017-02-16 12:32:07 -08:00
Christine Spang 3837e165c3 fix(watchman): There's some stuff in build/ we don't want to ignore 2017-02-16 12:17:17 -08:00
Evan Morikawa 75f38ec7cd fix(spec): re-enable NylasEnv specs and fix duplicate rejection log
Summary:
This re-enables NylasEnv spec and fixes a particularly tricky test
involving the Node event loop.

See the comments I left on process.unhandledRejection and the new spec

Test Plan: Manually run test in isolation and whole suite. All green!

Reviewers: juan, mark, halla, spang

Reviewed By: spang

Differential Revision: https://phab.nylas.com/D3942
2017-02-16 12:15:51 -08:00
Juan Tejada a42d67a77a 🎨(backoff-scheduler) Add getters 2017-02-16 12:15:17 -08:00
Mark Hahnenberg d654e80a96 [local-sync] Use new BatteryStatusManager to compute sync loop delay
Summary:
We don't need to check folders that often while on battery. Check every
5 minutes rather than every 10 seconds.

Test Plan: Run locally, verify the timeout is longer while on battery

Reviewers: evan, spang, juan

Reviewed By: spang, juan

Differential Revision: https://phab.nylas.com/D3940
2017-02-16 10:35:24 -08:00
Juan Tejada 000fa88ebb bump(version): 1.0.28 2017-02-16 00:18:52 -08:00
Juan Tejada aa105ff83f update(changelog) 2017-02-15 23:22:32 -08:00
Juan Tejada cd91a1777a bump(k2) 2017-02-15 22:10:46 -08:00
Mark Hahnenberg 71e2397ef3 [battery] Add BatteryStatusManager
Summary:
This adds a simple service to monitor whether the computer is plugged in
or not.

Test Plan: Run locally, verify that we correctly detect battery charging state

Reviewers: evan, spang, juan

Reviewed By: evan, spang, juan

Differential Revision: https://phab.nylas.com/D3937
2017-02-15 19:33:27 -08:00
Juan Tejada e15079874b [local-sync] 🎨 sync loop error handler
Summary: See title

Test Plan: manual

Reviewers: evan, mark, spang

Reviewed By: spang

Subscribers: mark

Differential Revision: https://phab.nylas.com/D3932
2017-02-15 18:46:41 -08:00
Mark Hahnenberg 5f4e5cbbdf [sentry] Don't use breadcrumbs in dev mode
Summary: They obscure the location of our logs in the dev tools.

Test Plan: Run locally, verify that logs link to proper place

Reviewers: evan, spang, juan

Reviewed By: spang, juan

Differential Revision: https://phab.nylas.com/D3939
2017-02-15 18:38:55 -08:00
Evan Morikawa f7e5683ec7 bump(K2) 2017-02-15 15:09:45 -08:00
Christine Spang dce9743283 [local-sync] Refresh Google OAuth2 tokens when Invalid Credentials occurs in sync loop
Summary:
Previously, we would only refresh Google OAuth2 access tokens at the
beginning of the sync loop, and _only_ if the access token had already
expired. This meant that if an access token expired in the middle of a
sync loop iteration, the user would get prompted with the reauth red box
for their account and would have to either go through the oauth flow
again or restart the app for sync to continue.

This diff makes two changes:

1. Adds 5min of padding to the refresh window, so if a token will expire
in <5min, we'll go ahead and refresh the token. This will reduce the
possibility that an access token can expire during a sync loop
iteration.

2. Catches Invalid Credentials IMAPAuthenticationErrors for Gmail
accounts and forces a token refresh on the next sync loop.

These should prevent a user from _ever_ having to reauth their Gmail
account unless the refresh token is revoked, or we encounter some other
permanent error trying to refresh the token.

Fixes T7775 (at least some cases)

Test Plan: manual

Reviewers: khamidou, evan, juan

Reviewed By: juan

Maniphest Tasks: T7775, T7755

Differential Revision: https://phab.nylas.com/D3908
2017-02-15 14:37:31 -08:00
Christine Spang 56422eee10 Add TODOs about retries in sending 2017-02-15 14:23:38 -08:00
Juan Tejada 8cbbc3ee1b fix(exports) Add backoff schedulers 2017-02-15 13:21:27 -08:00
Juan Tejada 152287b98c bump(k2) 2017-02-15 12:33:32 -08:00
Juan Tejada d3f0847f79 [local-sync] Add exponential backoff when retrying syncback tasks
Summary:
Instead of re-implementing exponential backoff, throw the retryable
error so the sync loop handles it and backs-off

Test Plan: manual

Reviewers: spang, halla

Reviewed By: halla

Differential Revision: https://phab.nylas.com/D3914
2017-02-15 12:31:43 -08:00
Juan Tejada a011d12b74 feat(offline) Re add offline status notification
Summary:
This commit rewrites the offline status notification from scratch, using
the `is-online` module (https://github.com/sindresorhus/is-online). The
react component no longer manages all of the state internally, but
rather depends on a separate OnlineStatusStore that manages the online state
for that component.

The new online status system will:

- Check online status every 30 seconds
- If status switches to offline:
  - Show notification
  - Recheck online status using exponential backoff
  - Notification will show remaining seconds until next online status
  check (like slack) (upon initial inspection this seemed to have no cpu problems.)
- If status switches to online
  - Hide notification
  - Revert to checking online status every 30 seconds

Depends on D3919

Test Plan: manual

Reviewers: spang, mark, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D3920
2017-02-15 12:30:28 -08:00
Evan Morikawa 532e096a21 bump(k2): SFDC 2017-02-15 11:33:37 -08:00
Evan Morikawa f409bf8be1 [SFDC] Update SalesforceSearchIndexer for new search indexing
Summary:
Update Salesforce to use the new search indexer

Depends on D3911

Test Plan: Manually bootup SFDC and ensure it launches and indexes models properly

Reviewers: mark, halla, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3913
2017-02-15 11:33:28 -08:00
Evan Morikawa 1526bbc31b reafctor(scheduler): Move SearchIndexer -> SearchIndexScheduler
Summary:
This renames `SearchIndexer` to `SearchIndexScheduler`

It also moves it out of internal_packages and into src/ since this is now
used across packages (like in Salesforce).

It also makes the class a Singleton and exports that instead so we don't
need to pass it via `activate`. The `activate` method of many stores and
packages are designed to be argumentless.

Test Plan:
Boot up Nylas and ensure it's still indexing threads properly.
Also allows Salesforce to bootup with the SalesforceSearchIndexer

Reviewers: juan, mark

Reviewed By: mark

Differential Revision: https://phab.nylas.com/D3911
2017-02-15 11:32:45 -08:00