💌 A beautiful, fast and fully open source mail client for Mac, Windows and Linux.
Go to file
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
apm feat(logging): Developer bar, verbose logging to logstash, Electron 0.26.0 2015-05-19 17:02:46 -07:00
arclib fix(drafts): Various improvements and fixes to drafts, draft state management 2015-02-03 16:24:31 -08:00
build add win32 exe renaming 2015-06-24 13:41:15 -07:00
docs-atom fix(asar): Support ASAR, and running of specs in prod builds 2015-05-21 14:41:30 -07:00
docs-templates Move guides from Edgehill repo to Redwood and only generate docs from classes 2015-06-02 16:24:56 -07:00
dot-nylas feat(update): autoupdater adds an updateLevel param 2015-06-11 12:23:31 -07:00
exports feat(message): New Message List UI 2015-06-22 15:49:52 -07:00
internal_packages refactor(DB): promisify database 2015-06-26 07:42:41 -07:00
keymaps feat(logging): Developer bar, verbose logging to logstash, Electron 0.26.0 2015-05-19 17:02:46 -07:00
menus feat(theming): Definitely not hacker mode. I don't know what you're talking about. 2015-06-05 11:40:44 -07:00
resources fix(asar): Support ASAR, and running of specs in prod builds 2015-05-21 14:41:30 -07:00
script fix(linux-build): Move the license file out of app so it works with ASAR 2015-05-21 18:22:11 -07:00
spec fix(specs): silence noisy specs and fix warnings 2015-06-15 18:29:59 -07:00
spec-nylas refactor(DB): promisify database 2015-06-26 07:42:41 -07:00
src refactor(DB): promisify database 2015-06-26 07:42:41 -07:00
static fix(*): minor fixes 2015-06-26 07:06:57 -07:00
vendor fix(quit): Destroy hot-loaded windows so they don't block quit - fixes T1282 2015-05-26 14:15:12 -07:00
.arcconfig [arcconfig] Change to https://phab.nylas.com/ 2015-05-18 11:19:25 -07:00
.gitattributes fix(drafts): Various improvements and fixes to drafts, draft state management 2015-02-03 16:24:31 -08:00
.gitignore add(specs): Empty folders and node_modules in spec fixture to fix specs 2015-06-03 10:23:54 -07:00
.gitmodules fix(drafts): Various improvements and fixes to drafts, draft state management 2015-02-03 16:24:31 -08:00
.node-version fix(drafts): Various improvements and fixes to drafts, draft state management 2015-02-03 16:24:31 -08:00
.npmrc fix(drafts): Various improvements and fixes to drafts, draft state management 2015-02-03 16:24:31 -08:00
.pairs fix(drafts): Various improvements and fixes to drafts, draft state management 2015-02-03 16:24:31 -08:00
.python-version fix(drafts): Various improvements and fixes to drafts, draft state management 2015-02-03 16:24:31 -08:00
atom.sh refactor(code): replace all instances of atom-shell and AtomShell and atomShell 2015-05-20 10:20:10 -07:00
coffeelint.json feat(docs): New docs tasks and React 0.13.2 2015-04-24 11:33:10 -07:00
CONTRIBUTING.md fix(drafts): Various improvements and fixes to drafts, draft state management 2015-02-03 16:24:31 -08:00
Dockerfile fix(drafts): Various improvements and fixes to drafts, draft state management 2015-02-03 16:24:31 -08:00
LICENSE.md fix(drafts): Various improvements and fixes to drafts, draft state management 2015-02-03 16:24:31 -08:00
package.json refactor(DB): promisify database 2015-06-26 07:42:41 -07:00
README.md fix(readme): Rip out Atom readme, replace with our own minimal one 2015-04-30 16:24:09 -07:00

Nylas Mail is a hackable platform for your personal data, built on Electron and the Nylas Platform APIs.

Building Nylas Mail

Extending Nylas Mail

It's easy to extend Nylas Mail using your favorite web technologies. Check out the Nylas Package API to get started, and the API reference for information about specific classes.