Summary: See diff title
Test Plan: Run locally, verify that we backoff on failure
Reviewers: evan, spang, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D3887
Summary: See diff title
Test Plan: Run locally, make sure we backoff
Reviewers: juan, spang, evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D3886
Summary:
Fixes T7832
The _savePromise mechanism of the IdentityStore was really cumbersome and
was throwing errors on the console for people. In hindsight, this is an
unnecessary complication to a very sensitive system and a source of very
hairy async bugs.
Test Plan:
I also updated the specs to ensure that when you call saveIdentity the
promise resolves after the local cache has been updated
Reviewers: spang, halla, juan
Reviewed By: juan
Maniphest Tasks: T7832
Differential Revision: https://phab.nylas.com/D3882
Summary:
The app regressed to launching a blank white page for a while before
showing the UI. This was because I forgot to await for the now async
package loading
Test Plan: Manually boot app with compile cache disabled
Reviewers: mark, spang, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D3883
Summary:
Previously, these tests were mostly testing the library itself, instead
of our code. The library performed expensive operations and caused the
test to time out more often than not
This commit makes it so we test our code, mock out any calls to side
effects, and removes a line that was overriding our jasmine timeout
Test Plan: unit
Reviewers: spang, evan, halla
Reviewed By: evan, halla
Differential Revision: https://phab.nylas.com/D3885
Summary:
This notification was randomly appearing and not going away on its own.
This was due to some weird logic in the react component. This diff
refactors things to make them a little more consistent.
Test Plan:
Run locally, disconnecting and reconnecting to make sure we properly
show and hide the notification.
Reviewers: evan, spang, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D3881
Summary:
Previously, when processing messages during folder sync, if the message already existed, and it belonged to a thread, we would update the message, but forget to update its thread with any changes that new
message would produce on the thread (e.g. updating the threads folders or labels).
One obvious manifestation of this was when replying to a thread: the EnsureMessageInSentFolderTask would create the new message, and then attempt to sync the sent folder to fetch the newly created message. When processing this message during sync, we would update the message but not update its thread, so the thread would not be associated to the sent folder, and it wouldn't show up in your sent items list in the UI.
Test Plan: manually verify that it works
Reviewers: evan, mark, spang
Reviewed By: mark, spang
Differential Revision: https://phab.nylas.com/D3872
Summary:
Our sentry reporter tries to fetch the nylas identity from the database,
and access properties on it. However, if you are in a state where there
is no identity available (like having logged out, or just starting the
app), and encoutnered an error that would be reported to sentry, we
would throw an error while reporting and that would crash the app
Also, fix lint errors and some really janky code
This fixes T7810
Test Plan: manual
Reviewers: halla, spang, evan
Reviewed By: spang, evan
Maniphest Tasks: T7810
Differential Revision: https://phab.nylas.com/D3867
Summary:
This commit modifies the api of NylasAPIRequest to /not/ take `success`
or `error` callback options at all, and only returns a Promise which you
can `then` and `catch` to handle the api response.
The fact that it returned a promise, and /also/ took `success` and
`error` callback options made it really confusing to use.
Additionaly, when using the callbacks intead of a promise, any errors
would be unhandled and reported to Sentry because even though the `error`
callback was being passed, the promise returned by `run()` still rejected and
no one was handling that reject, so it reached the `unhandledRejection` event
listener. This is undesirable because if you passed an `error` callback, it
means that you intended to handle it.
An example of this is calling the clearbit API, which will more often than
not return a 404, and even though we had an error handler which ignored the 404,
it still unecessarilly reported to Sentry, flooding it with events
Test Plan: manually check all updated codepaths still work
Reviewers: halla, spang, evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D3869
If the first argument to our local-sync logger is an object
(this is bunyan's api, and it's how we log from isomorphic-core and cloud-* packages
in order to have structured json logs for logstash), make sure we log
the object last and the string that comes as the second argument first.
Summary:
During the _onDOMMutated callback, we disconnect the mutation observer,
call some other callbacks, and then reconnect the mutation observer. If
we threw an error during the callbacks before reconnect the mutation
observer we would never get any more callbacks when the user changed
things in the composer, causing us to stop saving updates to drafts
(among other things). The fix is to just make sure that we always
reconnect the mutation observer using a finally clause.
Test Plan:
Run locally, make sure drafts are no longer truncated after spelling
correction (which was triggering an error to be thrown)
Reviewers: juan, evan, spang
Reviewed By: spang
Differential Revision: https://phab.nylas.com/D3864
Summary: Fixes T7649
Test Plan: FML writing unit tests now
Reviewers: evan, mark, juan
Reviewed By: mark, juan
Maniphest Tasks: T7649
Differential Revision: https://phab.nylas.com/D3863
Summary:
This error ocurred, to the best of our knowledge, on iCloud accounts
that had been linked to other clients like Airmail.
On such accounts, node-imap would incorrectly parse the mailbox list
from imap, and return an `Airmail` folder which did not exist, causing
us to try to sync that nonexistent folder and error in the sync loop.
This error is amongst the most frequent we've seen in Sentry and
Support: https://sentry.io/nylas/nylas-mail/issues/213158962/events/4897450600/
The fix es detailed in the PR to node-imap: https://github.com/mscdex/node-imap/pull/594/files
This commit only points the node-imap dependency to our fork for now
Test Plan: manual and unit tests in node-imap
Reviewers: mark, khamidou, spang
Reviewed By: spang
Differential Revision: https://phab.nylas.com/D3860
Summary:
This diff (and the K2 counterpart diff) allow us to run dev-mode Nylas
Mail side-by-side with prod Nylas Mail.
There were 4 things that needed to change:
1. Use different config dir
2. Use different keychain name
3. Use different localhost port
4. Prevent Electron's app.makeSingleInstance from killing our app
All of these are activated through NylasEnv.inDevMode()
Depends on D3861
Test Plan:
Download latest prod build from nylas.com
Remove both ~/.nylas-mail and ~/.nylas-dev
Start up downloaded Nylas Mail, connect accounts.
Run `npm start` (which enables --dev)
Connect account to dev mode
Ensure both clients are syncing and can send/receive mail
Reviewers: khamidou, halla, mark, spang, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D3862
Summary:
This diff (and the K2 counterpart diff) allow us to run dev-mode Nylas
Mail side-by-side with prod Nylas Mail.
There were 4 things that needed to change:
1. Use different config dir
2. Use different keychain name
3. Use different localhost port
4. Prevent Electron's `app.makeSingleInstance` from killing our app
All of these are activated through `NylasEnv.inDevMode()`.
Test Plan: Manual
Reviewers: halla, mark, spang, khamidou, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D3861