Commit graph

9 commits

Author SHA1 Message Date
Mark Hahnenberg ee438c7219 [thread-search] Add support for category search (i.e. "in:foo")
Summary: See title

Test Plan: Run locally, search for specific labels

Reviewers: evan, juan

Reviewed By: evan, juan

Differential Revision: https://phab.nylas.com/D3656
2017-01-13 11:53:41 -08:00
Mark Hahnenberg 668c2935c9 [thread-search] Improve local thread search
Summary:
Previously we waited to build the local ThreadSearch index until we were
done with the initial mail sync. This is undesirable because inboxes can
be very large, making local sync useless for a number of hours after a
user adds an account. This diff removes that restriction.

This diff also adds a new rudimentary new grammar (along with accompanying lexer
and parser) for local thread search queries. This grammar is then
translated into the appropriate SQL queries on the ThreadSearch index
table. More advanced features (e.g. in:category, date ranges, etc) can be added
easily in the future by augmenting this simple search query language.

Test Plan: Run locally, new unit tests

Reviewers: juan, evan, khamidou

Reviewed By: khamidou

Differential Revision: https://phab.nylas.com/D3614
2017-01-11 14:26:42 -08:00
Juan Tejada b29f46fdae fix(auth): Fix authentication notifications
Summary:
Depends on D3544 (K2 diff)

This commit ensures that auth notifications are showed when the
underlying sync worker fails and are cleared when an account is
successfully reconnected

To achieve this, we manually keep track and update syncStates where
appropriate via `Actions.updateAccount`, given that we have access to
N1's version of the account directly from local-sync.
Initially I was considering account delta stream to the cloud-api and the local-api, but that
just complicated things more than it helped.

This commit also fixes a bug with refreshing the gmail token in which we
we were only attempting a token refresh upon restarting the app

This addresses: T7346, T7305, T7335

Test Plan: Manual

Reviewers: halla, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D3545
2016-12-21 07:23:09 -05:00
Juan Tejada a2a897b369 fix(cal): Disable event search for now 2016-11-21 13:50:09 -08:00
Ben Gotow d53edbffea feat(db): background flag to exec queries in a single forked node process
Summary:
This is an initial attempt to fix an issue we’ve had with long-running queries interrupting the N1 user experience. Node-sqlite3 used an async approach that ran sqlite’s synchronous query methods on a worker thread, but doing that involves copying memory more and node-sqlite3 was just generally slow.

However, moving to better-sqlite3 made /everything/ synchronous. Even with the right indexes some of our queries just suck.

This diff adds `DatabaseStore.findAll(…).background().then()` which allows you to mark a query as “unimportant”. These queries are run in a separate process which is forked from the window and can take an extra 10-50ms to complete. That said, they’re totally async and don’t jam up the app.

I’m personally a fan of the flag and less a fan of the implementation. The “agent” process can handle many queries in it’s lifetime if they keep coming and quits after 10 seconds of inactivity. (Both to save memory and to avoid scenarios where it might end up oprhaned and running forever). While running it uses about 40MB of RAM, which is a bit on the crazy side.

Test Plan: No new tests yet

Reviewers: evan, juan

Reviewed By: evan, juan

Differential Revision: https://phab.nylas.com/D3420
2016-11-16 17:47:24 -08:00
Juan Tejada d3dcf89e9f feat(event-search): Add event search to calendar
Summary:
This commit adds the ability to perform event search in the calendar window.
To achieve this, SearchBar has been moved from the thread-search package to be a part
of the nylas-component-kit, and reused by both thread-search and nylas-calendar

When an event is selected from search results, the calendar view is moved to the selected
event. Depends on D3396 to open the event popover.

Test Plan: Manual

Reviewers: halla, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D3424
2016-11-15 17:27:31 -08:00
Evan Morikawa ec90dcf646 refactor(search): extract generic ModelSearchIndexer 2016-11-14 14:01:00 -08:00
Ben Gotow 80b315d708 deps(*): Lift deps out of packages for simpler install / better deduping 2016-11-09 14:24:10 -08:00
Ben Gotow c59fc486d7 fix(search): Rename package, fix column naming issue 2016-11-02 13:13:16 -07:00