Commit graph

5384 commits

Author SHA1 Message Date
Halla Moore f86ff97062 fix(n1-spec-runner): Make fit async too
Summary: Running async tests with `fit` can fail otherwise

Test Plan: unit tests

Reviewers: juan, evan

Reviewed By: juan, evan

Differential Revision: https://phab.nylas.com/D3874
2017-02-10 15:41:07 -08:00
Halla Moore 0e5aebb91d fix(tests): Allow the masterBefore/AfterEach functions to be async
Summary:
The global `before/afterEach` functions were made async, but the
`masterBefore/AfterEach` functions were applied to the references
in `jasmineExports` instead of the global references. Fix that,
and await for `destroyTestDatabase()`. Also fix a random test
failure about not receiving any json.

This diff is necessary for D3878 to work properly.

Test Plan: ran the tests

Reviewers: juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D3890
2017-02-10 15:38:55 -08:00
Halla Moore 2d3bb52bc8 [local-sync] Properly clean-up in-memory test database
Summary: There's no file to unlink, we just need to drop the tables.

Test Plan: manual

Reviewers: evan, juan

Reviewed By: evan, juan

Differential Revision: https://phab.nylas.com/D3878
2017-02-10 15:37:58 -08:00
Evan Morikawa 614992f550 bump(k2) 2017-02-10 18:21:06 -05:00
Evan Morikawa e646d56bf8 [local-sync] fix sync when no messages in inbox in gmail
Summary:
If you have no messages in your Gmail Inbox (Yay Inbox Zero!) and you
connect your account and do first sync, then we get an error where we try
and fetch a range from null to -1.

This was due to a logical error in the first sync fetch code.

This diff fixes this bug and renames some variables to make it clearer
what's going on

Fixes T7842

{F11176}

Test Plan:
1. Bring Gmail to Inbox Zero
2. Connect account
3. Verify first sync works

Reviewers: spang, halla, juan

Reviewed By: juan

Maniphest Tasks: T7842

Differential Revision: https://phab.nylas.com/D3889
2017-02-10 18:20:53 -05:00
Juan Tejada 8d36ce6723 Actually fix travis 2017-02-10 15:16:07 -08:00
Juan Tejada d558990ecf fix(build) Fix travis build script 2017-02-10 15:11:43 -08:00
Juan Tejada cab1acfcc9 fix(build/travis) Only run tests on mac 2017-02-10 15:01:50 -08:00
Evan Morikawa f33667e1a1 fix(specs): fix FeatureUsage spec
Summary: Damn async TaskQueue

Test Plan: fixed

Reviewers: juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3888
2017-02-10 16:49:40 -05:00
Mark Hahnenberg 9c3dd29c10 [files] Add retry with exponential backoff for file downloads in NM
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
2017-02-10 13:47:21 -08:00
Mark Hahnenberg 8f08328329 [files] Add retry with exp backoff to IMAP connections for file download requests
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
2017-02-10 13:29:12 -08:00
Evan Morikawa 31ae05fed2 fix(identity): remove the savePromise and optimistically update
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
2017-02-10 15:52:57 -05:00
Evan Morikawa 8a18ac3e14 fix(load): fix window load timing
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
2017-02-10 15:52:40 -05:00
Juan Tejada 3a49bfe448 fix(specs) Fix Spellchecker tests
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
2017-02-10 12:36:07 -08:00
Juan Tejada 6d379efba1 fix(specs) Use shallow rendering
Now that we have 15.4.2, we don't have to worry about:
https://github.com/facebook/react/pull/8097
2017-02-10 12:19:38 -08:00
Juan Tejada 0638b843b6 fix(specs) Synchronously render test reporting gui for better stack traces 2017-02-10 12:19:18 -08:00
Juan Tejada ad88dc3fe8 bump(react) 15.4.2 2017-02-10 12:17:34 -08:00
Mark Hahnenberg a71dabbe7a [cleanup] Remove random option that's no longer used
Summary: See diff title

Test Plan: yolo

Reviewers: juan, evan, spang

Reviewed By: spang

Differential Revision: https://phab.nylas.com/D3873
2017-02-10 10:17:15 -08:00
Mark Hahnenberg b030eee5c5 [notifications] Fixup "Nylas is Offline" notification
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
2017-02-10 10:15:52 -08:00
Juan Tejada 8b91fa9780 fix(api-error) Fix APIError constructor 2017-02-10 09:28:04 -08:00
Juan Tejada 31dc6d67cf bump(version) 1.0.25 2017-02-09 23:54:20 -08:00
Juan Tejada d1f3c9c042 fix(specs) Fix react warning 2017-02-09 16:56:29 -08:00
Juan Tejada 61543a0c6e fix(specs) Fix spellchecker tests 2017-02-09 16:35:52 -08:00
Evan Morikawa eb5aa235a8 fix(build): re-add specs back into build process 2017-02-09 19:07:00 -05:00
Evan Morikawa ceaad6b13c fix(specs): fix util specs 2017-02-09 19:05:19 -05:00
Evan Morikawa e7ffb974e4 [local-sync] rename spec fixture folder to be correct 2017-02-09 19:05:04 -05:00
Juan Tejada c3d2d0563f fix(specs) lock enzyme version 2017-02-09 15:45:22 -08:00
Juan Tejada 3fff1227e8 fix(specs) Fix tokenizingfield specs 2017-02-09 15:32:32 -08:00
Evan Morikawa 703da64253 fix(specs): fix more tests 2017-02-09 18:29:30 -05:00
Evan Morikawa 7ae89927e1 fix(specs): fix more broken specs 2017-02-09 18:17:11 -05:00
Juan Tejada 6856a2ccf7 [local-sync] When replying to a thread, properly add it to Sent folder
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
2017-02-09 15:04:12 -08:00
Evan Morikawa ccaf78ce99 fix(specs) fix specs logging erroneous error messages 2017-02-09 17:51:43 -05:00
Mark Hahnenberg 3fa07164f8 [keytar] Report errors when keytar fails to load passwords
Summary: See title

Test Plan: yolo

Reviewers: evan, spang, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3871
2017-02-09 14:50:32 -08:00
Juan Tejada ce43d1c2c9 fix(specs) Fix ClipboardService specs 2017-02-09 13:57:27 -08:00
Juan Tejada c44324e636 fix(specs) Fix AutoUpdateManager specs 2017-02-09 13:29:50 -08:00
Juan Tejada ba464e9f21 fix(spec) Never report errors in spec mode 2017-02-09 13:11:10 -08:00
Evan Morikawa eca7f2cd6d fix(spec): fix package manager spec 2017-02-09 15:17:58 -05:00
Evan Morikawa 078a6a253f fix(error): fix error reporter crashing with extra errors 2017-02-09 15:09:49 -05:00
Christine Spang b33653bdd8 🎨 s/N1/Nylas Mail/ in window hang/crash dialogs 2017-02-09 10:52:37 -08:00
Juan Tejada 738ab3866d update changelog 2017-02-09 10:40:03 -08:00
Juan Tejada 36f18c273d bump(version) 1.0.24 2017-02-09 10:30:17 -08:00
Juan Tejada cec55f7188 [local-sync] Fix logger for local requests
Also log send task correctly
2017-02-09 10:25:08 -08:00
Juan Tejada 3f872a5b40 bump k2 2017-02-09 09:27:51 -08:00
Juan Tejada 600be97324 [local-sync] Don't crash app when reporting error and id not available
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
2017-02-09 09:27:36 -08:00
Juan Tejada 1e34a2e33b 🎨 Fix unhandled api rejections/Prefer promises over success option for api requests
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
2017-02-09 09:19:55 -08:00
Juan Tejada e6afea45a0 [local-sync] Prefer promises over success option for api requests
Summary: Companion D3869

Test Plan: manual

Reviewers: halla, spang, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D3868
2017-02-09 09:19:19 -08:00
Juan Tejada 9e55e9d4c9 bump(changelog) 2017-02-09 00:28:24 -08:00
Juan Tejada 01580a931f update gitignore 2017-02-08 20:36:12 -08:00
Juan Tejada 1d3b301714 fix(metrics) Report task perf metrics to mixpanel
Summary: see title

Test Plan: manual

Reviewers: spang, evan, mark

Reviewed By: mark

Differential Revision: https://phab.nylas.com/D3866
2017-02-08 20:06:55 -08:00
Juan Tejada 767edd7b6e bump(version) 1.0.23 2017-02-08 18:43:53 -08:00