Summary:
Previously we were only debouncing one function in onContentChanged. This would
cause us to do very expensive things on every keypress in the things that
weren't debounced. This diff changes things so that we debounce the entire
process of running the spellchecker.
Test Plan:
Run locally, make sure spellchecker doesn't run on every keypress.
Misspell lots of things, type really quickly, paste large chunks of text
into the composer.
Reviewers: evan, spang, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D3791
Summary: It is better to notify that a task failed rather than having a thread or group of threads randomly bounce back.
Test Plan: manual
Reviewers: evan, spang, mark, halla
Reviewed By: mark, halla
Subscribers: mark
Differential Revision: https://phab.nylas.com/D3790
Summary:
Users who only had a custom imap account could not open the window to
add a custom imap account the first time the auth was opened, rendering
the app useless for them.
Github issue #3185 and T7691
Test Plan: manual
Reviewers: halla, spang, evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D3783
Summary:
These windows don't need to receive IPC until they're being used for something
(i.e. after transitioning from hot window to composer, popout, etc)
Test Plan:
Run locally w/ hot windows shown, make sure that hot window doesn't
receive IPC
Reviewers: evan, spang, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D3780
Summary: See diff title
Test Plan: Run locally, check in htop for new titles
Reviewers: evan, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D3778
Summary:
Adds a new `npm run test-window` that will launch specs in a window so you
can use the debugger
The spec window wouldn't close because `onbeforeunload` was unnecessarily
preventing close. This circumvents this in spec mode.
Most significantly I discovered we can't use the synchronous timer for the
promise scheduler anymore. Suppose you do:
```
it('should error', async () => {
try {
await doSomething()
throw new Error("doSomething should have thrown!")
} catch (err) {
expect(err.message).toMatch(/my message/)
}
})
```
The way async/await is transpiled, when `doSomething` throws, the error
will propagate all the way back up to the uncaughtPromiseException handler
before the `catch` gets called and registered. The transpilation method
assumes that when the function gets executed it can synchrously advance
beyond the call before the `then` or `catch` resolve. When the promise
scheduler is synchronous this doesn't happen.
I chose to use `setTimeout` instead of `process.nextTick` or
`setImmediate` as the promise scheduler. `setTimeout` seems to work better
with Chrome's async function call stacks. `nextTick` and `setImmediate`,
being Node methods, skip Chrome's async watchers.
Test Plan:
I talked with Juan about these changes, in an upcoming diff he will be
testing these in the context of our broader test suite.
Reviewers: mark, khamidou, halla, spang, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D3779
Summary: This bumps the spellcheck and restores the specs
Test Plan:
Manually open a composer, type some text and ensure it underlines them as
misspelled. Also restore test coverage
Reviewers: mark, halla, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D3776
Summary:
Sometimes you have to perform a query that needs to do a table scan. For those
times you don't want to silence entire classes of queries (e.g. by table name),
you can now silence individual queries.
Test Plan: Run locally, verify that noisy stuff disappears from logs
Reviewers: evan, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D3763
Summary:
This removes `refreshHealthOfAccounts`, which I originally found because I
was trying to refactor it out of the IdentityStore. We need it gone from
the IdentityStore so that store can trigger frequently as things like the
usageLimits constantly update on it.
This also fixes T7520 where we'd get `ECONNREFUSED 127.0.0.1:2578` on
launch unnecessarily.
The concept of refreshing the health of accounts by occassionally polling
the /accounts endpoint is obsolete. This depends on
D3769 which entirely removes the /accounts endpoint
from K2.
Account health is pushed to us by `Actions.updateAccount` which is fired
directly from the main local-sync sync loop.
This also removes `refreshAccounts` and `Actions.refreshAllDeltaConnections`. These were fired by the Identity Store whenever it updated. We no longer need the Identity Store to tell us to reset the delta connections with our local-sync accounts. The delta connections will either be reset by our offline notification button, or when adding or removing an account. The Identity Store was a redundant mechanisms
Test Plan:
Manually verify things work with an existing account. Add a new account
and ensure sync starts. Remove an account and ensure it gets cleaned up.
Reviewers: halla, khamidou, mark, juan
Reviewed By: juan
Maniphest Tasks: T7520
Differential Revision: https://phab.nylas.com/D3770
Summary:
This diff is a rename. No logical changes.
We used to have a set of files called `nylas-sync-worker`. In Old N1 these
used to have a lot of logic to slowly sync mail from our API. Since we
exclusively use local-sync via a soon-to-be-obsolesced delta stream, these
files really just manage the delta streaming connection.
It's incredibly confusing to have a set of files called worker-sync when
there's a sync-worker already in the codebase. This renames everything to
refer to them as account sync workers.
The reason I wanted this rename is because the IdentityStore on initial
launch triggers and fires a fairly scary-sounding
`Actions.refreshAllSyncWorkers()`. In reality all it does is
`Actions.refreshAllDeltaConnections()`. I'm also tired of staring at files
for a full minute before realizing that this is not the sync worker I was
looking for.
Test Plan:
After rename, booted the app and ensured that deltas were coming through
for new mail and no errors were being thrown
Reviewers: halla, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D3767