Summary:
Moves all reading / writing of config file to the main process,
to avoid needing to write code to lock across processes. This should also
be more efficient than re-loading the file in all processes when it's
saved.
Test Plan: Run tests
Reviewers: evan, jackie
Reviewed By: evan, jackie
Differential Revision: https://phab.nylas.com/D2963
Summary: This is mostly config changes.
Test Plan: Tested the Google OAuth flow.
Reviewers: bengotow, drew
Reviewed By: bengotow, drew
Differential Revision: https://phab.nylas.com/D2907
Summary:
This diff is designed to dramatically speed up new window load time for
all window types and reduce memory consumption of our hot windows.
Before this diff, windows loaded in ~3 seconds. They now boot in a couple
hundred milliseconds without requiring to keep hot windows around for
each and every type of popout window we want to load quickly.
One of the largest bottlenecks was the `require`ing and initializing of
everything in `NylasExports`.
I changed `NylasExports` to be entirely lazily-loaded. Drafts and tasks
now register their constructors with a `StoreRegistry` and the
`TaskRegistry`. This lets us explicitly choose a time to activate these
stores in the window initalization instead of whenever nylas-exports
happens to be required first.
Before, NylasExports was required first when components were first
rendering. This made initial render extremely slow and made the proposed
time picker popout slow.
By moving require into the very initial window boot, we can create a new
scheme of hot windows that are "half loaded". All of the expensive
require-ing and store initialization is done. All we need to do is
activate the packages for just the one window.
This means that the hot window scheme needs to fundamentally change from
have fully pre-loaded windows, to having half-loaded empty hot windows
that can get their window props overridden again.
This led to a major refactor of the WindowManager to support this new
window scheme.
Along the way the API of WindowManager was significantly simplifed.
Instead of a bunch of special-cased windows, there are now consistent
interfaces to get and `ensure` windows are created and displayed. This
DRYed up a lot of repeated logic around showing or creating core windows.
This also allowed the consolidation of the core window configurations into
one place for much easier reasoning about what's getting booted up.
When a hot window goes "live" and gets populated, we simply change the
`windowType`. This now re-triggers the loading of all of the packages for
the window. All of the loading time is now just for the packages that
window requires since core Nylas is there thanks to the hot window
mechanism.
Unfortunately loading all of the packages for the composer was still
unnaceptably slow. The major issue was that all of the composer plugins
were taking a long time to process and initialize. The solution was to
have the main composer load first, then trigger another window load
settings change to change the `windowType` that loads in all of the
plugins.
Another major bottleneck was the `RetinaImg` name lookup on disk. This
requires traversing the entire static folder synchronously on boot. This
is now done once when the main window loads and saved in a cache in the
browser process. Any secondary windows simply ask the backend for this
cache and save the filesystem access time.
The Paper Doc below is the current set of manual tests I'm doing to make
sure no window interactions (there are a lot of them!) regressed.
Test Plan: https://paper.dropbox.com/doc/Window-Refactor-UYsgvjgdXgVlTw8nXTr9h
Reviewers: juan, bengotow
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D2916
Summary:
Notify the backend when auth is a reauth of an existing account by
providing the `accountId`. This lets the backend differentiate between
a new auth (where a new account will be created if the server endpoints
don't match) and a re-auth (where the auth will fail on server endpoint
mismatch, prompting the user).
Test Plan: manual
Reviewers: juan, evan, bengotow
Reviewed By: bengotow
Subscribers: mg, spang, kav-ya
Differential Revision: https://phab.nylas.com/D2833
Summary: fix(account): allow users to reconnect accounts if auth has failed
Test Plan: manual
Reviewers: bengotow, juan
Differential Revision: https://phab.nylas.com/D2663
Summary:
Now that IMAP auth without SSL is enabled,
those checkboxes that weren't doing anything can come
back.
Test Plan:
This change isn't fully tested and should be thoroughly
inspected (on staging?) before rollout. The N1 end works and sends
parameters correctly, but a 401 prevented local testing of the
interface between N1 auth and sync-engine auth.
Reviewers: bengotow, drew
Reviewed By: drew
Subscribers: kav-ya
Maniphest Tasks: T6666
Differential Revision: https://phab.nylas.com/D2632
Summary:
Some of our users who reauth are getting weird errors from Google — it seems that in some cases Google OAuth doesn’t pass us a `refresh_token`, even though we ask for one by passing `approval_prompt=force` (I’ve landed a commit to log more details about this in edgehill-server —- 6e984ffa26 — but this won’t fix the problem).
Apparently, Google recently « soft-deprecated » `approval_prompt` in favor of a new parameter called `prompt`, which does mostly the same thing (https://developers.google.com/identity/protocols/OAuth2WebServer#formingtheurl)
This diff replaces `approval_prompt` by `prompt`.
Test Plan: Tested by authing a Gmail account and checking that it worked.
Reviewers: bengotow
Reviewed By: bengotow
Subscribers: emfree
Differential Revision: https://phab.nylas.com/D2557
Summary:
The error message from D2515 is being upgraded to also disable the
continue button so that a user is unable to sync an @gmail.com account
using the IMAP flow.
Test Plan: Tested locally.
Reviewers: bengotow
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D2516
Summary:
Users have been configuring their Gmail accounts using the IMAP
authentication method, which causes problems. Attempting to do so will
now create an error message.
Test Plan: Tested locally.
Reviewers: bengotow
Reviewed By: bengotow
Subscribers: mg, emfree
Maniphest Tasks: T6621
Differential Revision: https://phab.nylas.com/D2515
Summary:
The goal is to let us see what plugins are throwing errors on Sentry.
We are using a Sentry `tag` to identify and group plugins and their
errors.
Along the way, I cleaned up the error catching and reporting system. There
was a lot of duplicate error logic (that wasn't always right) and some
legacy Atom error handling.
Now, if you catch an error that we should report (like when handling
extensions), call `NylasEnv.reportError`. This used to be called
`emitError` but I changed it to `reportError` to be consistent with the
ErrorReporter and be a bit more indicative of what it does.
In the production version, the `ErrorLogger` will forward the request to
the `nylas-private-error-reporter` which will report to Sentry.
The `reportError` function also now inspects the stack to determine which
plugin(s) it came from. These are passed along to Sentry.
I also cleaned up the `console.log` and `console.error` code. We were
logging errors multiple times making the console confusing to read. Worse
is that we were logging the `error` object, which would print not the
stack of the actual error, but rather the stack of where the console.error
was logged from. Printing `error.stack` instead shows much more accurate
stack traces.
See changes in the Edgehill repo here: 8c4a86eb7e
Test Plan: Manual
Reviewers: juan, bengotow
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D2509
Summary:
adds new option to launch on system start
Also adds the `--background` flag to launch N1 in the background (aka not
show the main window).
Test Plan: Manual
Reviewers: bengotow, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D2474
Summary:
This diff bundles a number of small usability fixes to the "Create account" window. It notably:
- forces users to enter required fields before moving on to the next step
- validates email addresses and domain names
Test Plan: Tested manually by going through all the possible auth flows.
Reviewers: evan, juan, bengotow
Reviewed By: bengotow
Subscribers: bengotow
Projects: #edgehill
Differential Revision: https://phab.nylas.com/D2377
Summary:
- WIP: Need to fix tests and some errors!
- Refactors Category class to hold information about its type
- Refactors CategoryStore to rely on observables instead of local caches
- Adds and updates Observables and helpers
- Refactors ContactStore to hold entire cache of contacts instead of per
current account
- Same for ContactRankingStore and other stores
- Refactors method names for AccountStore + some helpers
- Updates MailViewFilter to hold an account
- Adds basic Unified filter
- Replaces AccountStore.current calls with either:
- The account of the currently focused MailViewFilter
- The account associated with a thread, message, file, etc...
- A parameter to be passed in
- Arbitrarily, the first account in the AccountsStore
Test Plan: - Unit tests
Reviewers: evan, bengotow
Differential Revision: https://phab.nylas.com/D2423
Electron 0.35.1 includes the tray fixes we contributed last week but also includes API restructuring and improvements. Most importantly, modules from electron are now imported via `require('electron')`