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
Summary:
This will help us dry up exponential backoffs we have scattered in
several places
Test Plan: unit tests
Reviewers: mark, spang, evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D3919
Summary:
This component was running into a hard loop trying to constantly, unnecessarily,
re-establish the delta connection to our n1cloud servers.
Test Plan: manual
Reviewers: mark, evan, spang
Reviewed By: evan, spang
Differential Revision: https://phab.nylas.com/D3918
Summary: Report delta errors and exponential backoff when errors arise
Test Plan: Manually throw Errors in various parts of the delta stream
Reviewers: spang, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D3917
Summary:
We were doing a lazy job of removing prefixes and suffixes by filtering
any and all prefixes or suffixes from any part of a Contact's name which
was leading to some odd truncations.
Test Plan:
Run locally, verify that 'Nylas Mail General' contact has proper name
when participant text field is collapsed.
Reviewers: evan, spang, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D3904
Summary:
Re-enable DatabaseStore specs and use new async model that awaits for the
promises to resolve
Test Plan: new tests
Reviewers: spang, halla, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D3909
Summary:
Some plugins (like the Salesforce Plugin) register Models with the
database store. Upon plugin load, we check to see if there are newly
registered models, if there are, we try and refresh the database.
Unfortunately the database refresh was not being `await`ed for. This means
the `activate` method of the plugin was called before the models were
created creating DB errors.
Making `refreshDatabaseSchema` something you can `await` for requied
adding an async ready hook on the DatabaseStore itself that will work in
all windows, even though setup is only happening in one window.
Test Plan:
Turn DatabaseStore.DEBUG_TO_LOG = true and run before and after the patch
with SFDC enabled. See that after the patch the DB setup happens before
activate gets called
Reviewers: halla, spang, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D3906
Summary:
When loading accounts, if we detect any removed accounts, we should get
rid of the tokens for that account as well.
Test Plan: manually removed accounts, everything seems a-ok
Reviewers: mark, evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D3907
Summary:
The current error condition check is to make sure that accounts are exclusively
removed via `Actions.removeAccount`. However, when removing accounts,
the in-memory `AccoutStore`s in each window are kept in sync via listening
to the config, as opposed to dispatching Actions globally between windows
(Actions.removeAccount is scoped to a single window, see actions.es6).
So, when we remove an account in one window, config.json will change, and the
other windows will always encounter `removedIds.length > 0` to be true
when their `_loadAccounts` runs. This will only generate unecessary noise in Sentry.
Test Plan: manual
Reviewers: mark, evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D3902
Summary:
- Create ghost models if we receive metadata for an object we
haven't synced yet
- Fix logic for finding equivalent threads
- Send `messageIds` when syncing thread metadata
See D3876 for unit tests
K2 pairing: D3880
Test Plan: unit tests, local testing soon
Reviewers: juan, evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D3875
Summary:
See title.
I believe this might fix T7559, or at least provide a better error message.
Depends on D3895
Test Plan: manual
Reviewers: spang, mark, halla, evan
Reviewed By: mark, halla, evan
Maniphest Tasks: T7559
Differential Revision: https://phab.nylas.com/D3897
Summary:
If the worker window were to restart or the app were to close in the
middle of a send task, sending to a single recipient, we would not
properly await the task and always mark as success.
This diff, along with (D3897) should fix T7559.
Test Plan: manual
Reviewers: spang, mark, evan, halla
Reviewed By: mark, evan, halla
Maniphest Tasks: T7559
Differential Revision: https://phab.nylas.com/D3895
Summary:
A prerequesite to integrating with `arc unit` or CI for each patchset is
being able to generate JUnit XML output for spec runs. This commit adds
this feature using the JUnitXMLReporter from jasmine-reporters. Invoke it like
this:
npm run test-junit
(We output to the terminal as well when this is run, so in the case that
you're doing `arc diff` you have some idea of what is going on.)
Test Plan: run it
Reviewers: halla, juan, evan
Reviewed By: juan, evan
Differential Revision: https://phab.nylas.com/D3891
Before this commit, running the running the tests would clear all of
your config inside `.nylas-dev` and thus your accounts, forcing you to re-add
them everytime after you ran the tests
This was happening because we weren't correctly setting the
`configDirPath` to `.nylas-spec` when running with the --test flag. When
we run with --test, both options, `specMode` and `devMode` are true, so
the logic to set the path would fall into both conditions and ultimately
set the path to `.nylas-dev`. Now it's fixed!
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
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:
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