Mailspring/internal_packages
Evan Morikawa e8d24ea1b5 refactor(DB): promisify database
Summary:
WIP. The app launches and works for me. I still need to fix the tests
just the DB ones though :D

I changed the `DatabaseProxy` into a `DatabaseConnection` object. It will
request a fully instantiated databse from the backend Browser.

If we're already setup, it'll connect straight to the existing DB.

If we're not setup, then it'll create a new database and run the inital
schema migration on it. The `_createNewDatabase` promise won't resolve
until the migration has run.

Until we add in a more sophisticated migration system and get rid of the
stupid `modelClassMap` that's shoved in `Utils`, I'm passing in a series
of `_setupQueries()` to get everything started.

The `DatabaseConnection` is also the one responsible for queuing up
queries until the DB is fully populated and ready to go.

We actually get a lot of queries before we're setup because a lot of
Stores will make DB requests on `require` in their `constructor` or `init`
methods. (remember all the times we call `_populateStore` in `init`).

Now those queries are aggregated by the `DatabaseConnection` and then
executed sequentially.

Our methods like `persistModel` now resolve only after both the queries
have completed AND their corresponding `triggerLater` has completed as
well.

Test Plan: in progress

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1688
2015-06-26 07:42:41 -07:00
..
account-sidebar feat(starring): Star and unstar threads in the thread list 2015-06-08 17:02:50 -07:00
attachments refactor(DB): promisify database 2015-06-26 07:42:41 -07:00
calendar-bar refactor(utils): switch to regular underscore 2015-05-19 16:06:59 -07:00
composer refactor(DB): promisify database 2015-06-26 07:42:41 -07:00
developer-bar fix(*): Throttle so that DatabaseView won't pile on queries during scroll, better small attachment styles 2015-06-19 11:31:27 -07:00
file-list feat(attachment): improved downloading and draggable images 2015-06-15 18:48:17 -07:00
inbox-contact-elements refactor(utils): switch to regular underscore 2015-05-19 16:06:59 -07:00
message-list fix(*): minor fixes 2015-06-26 07:06:57 -07:00
message-templates feat(salesforce): new UI for Salesforce 2015-06-17 20:40:08 -07:00
mode-switch feat(theming): Definitely not hacker mode. I don't know what you're talking about. 2015-06-05 11:40:44 -07:00
notification-mailto refactor(utils): switch to regular underscore 2015-05-19 16:06:59 -07:00
notification-update-available fix(notifications): Give notifications tag like HTML5 Notifications so you can de-dupe 2015-05-25 10:27:36 -07:00
notifications fix(nylas-api): Globally handle 401s and notify user they need to sign in 2015-06-17 12:29:49 -07:00
onboarding feat(salesforce): new UI for Salesforce 2015-06-17 20:40:08 -07:00
search-bar fix(search): remove red search x 2015-06-18 09:43:18 -07:00
settings fix(thread-list): Narrow mode, and new selection rules for three-pane 2015-06-11 18:00:40 -07:00
sidebar-fullcontact feat(salesforce): new UI for Salesforce 2015-06-17 20:40:08 -07:00
sidebar-inbox-internal Adding ATag component which prevents <a> tags from taking over edgehill when clicked. 2015-06-25 10:28:31 -07:00
thread-list fix(*) Minor friday fixes - see description 2015-06-19 16:07:24 -07:00
today fix(nylas-api): Globally handle 401s and notify user they need to sign in 2015-06-17 12:29:49 -07:00
tooltip feat(theming): Definitely not hacker mode. I don't know what you're talking about. 2015-06-05 11:40:44 -07:00
ui-dark feat(theming): Definitely not hacker mode. I don't know what you're talking about. 2015-06-05 11:40:44 -07:00
ui-light fix(build): Temporarily disable 'Task' tests Jenkins can't run, and avoid empty ui-variables files 2015-06-03 12:04:43 -07:00
unread-badge fix(*): Resolve a variety of small and simple bugs 2015-06-05 11:02:44 -07:00
unread-notifications fix(thread-list): Narrow mode, and new selection rules for three-pane 2015-06-11 18:00:40 -07:00