Summary:
Move sync workers and Edgehill token checks to work window
Move the task queue and database setup to the work window
Move ContactStore background refresh to work window
Store the task queue in the database
WIP
The TaskQueue now puts tasks in the database instead of in a file, which also means it can be observed
Move all delta sync and initial sync to a package, make NylasSyncStore which exposes read-only sync state
DraftStore no longer reads task status. Once you set the "sending" bit on a draft, it never gets unset. But that's fine actually.
If your package lists windowTypes, you *only* get loaded in those windowTypes. If you specify no windowTypes, you get loaded in the root window.
This means that onboarding, worker-ui, worker-sync, etc. no longer get loaded into the main window
ActivitySidebar has a special little store that observes the task queue since it's no longer in the window
Move "toggle component regions" / "toggle react remote" to the Developer menu
Move sync worker specs, update draft store specs to not rely on TaskQueue at all
Test Plan: Run existing tests, all pass
Reviewers: dillon, evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D1936
Summary: Emergency fix for broken logic consuming delta updates. Also includes specs for untested functionality.
Test Plan: Run new tests
Reviewers: dillon, evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D1939
Summary:
This diff replaces the Namespace object with the Account object, and changes all references to namespace_id => account_id, etc. The endpoints are now `/threads` instead of `/n/<id>/threads`.
This diff also adds preliminary support for multiple accounts. When you log in, we now log you in to all the attached accounts on edgehill server. From the preferences panel, you can auth with / unlink additional accounts. Shockingly, this all seems to pretty much work.
When replying to a thread, you cannot switch from addresses. However, when creating a new message in a popout composer, you can change the from address and the SaveDraftTask will delete/re-root the draft on the new account.
Search bar doesn't need to do full refresh on clear if it never committed
Allow drafts to be switched to a different account when not in reply to an existing thread
Fix edge case where ChangeMailTask throws exception if no models are modified during performLocal
Show many dots for many accounts in long polling status bar
add/remove accounts from prefs
Spec fixes!
Test Plan: Run tests, none broken!
Reviewers: evan, dillon
Reviewed By: evan, dillon
Differential Revision: https://phab.nylas.com/D1928
Summary:
Adding serialzable registry
Added DatabaseObjectRegistry
rename modelReviver to deserializeObject
Consolidate deserizlie
Get rid of model methods from Utils
DatabaseRegistry change notifications
Logic to throttle database refresh requests
Fixes in nylas-exports
Silent model setup
Continue to resolving the database setup phase for non main windows.
A packages `activate` method does not actually get called until the
DatabaseStore says that it's ready. This is necessary to ensure that a
package that introduces database changes has those schema changes take
hold before the activate happens.
However, in windows like the `onboarding` window that do not depend on a
database at all, there is no setup that is run and the promise use to
never resolve thereby making the packages never activate.
In this case, any external windows will go ahead and let their packages
activate.
Check subclass instead of instance!
Use the correct types for "messages" and "drafts"
Move Salesforce models
Proper references to Model and Attributes
Convert Salesforce stores to NylasStores and fix paths
Move database setup to DB
Test Plan: todo
Reviewers: bengotow
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D1899
Summary: Threads are now sorted using the thread's receivedrecentdate instead of recentdate
Test Plan: Tested Manually
Reviewers: bengotow
Reviewed By: bengotow
Subscribers: mg
Differential Revision: https://phab.nylas.com/D1812
Summary:
We need to remove quoted text completely from bodies in a composer.
Unfortunately, that makes it very difficult to determine how to put it
back in.
For now the scheme is to append the quoted text at the end. However, that
means that we need to only pull out quoted text at the end of a message.
Unfortunately there are lots of places that quoted text appears inline
with regular text.
Determining whether or not some content is at the "end" of a message
turned out to be non-trivial.
We now have a new `DOMUtils` that looks for empty areas at the end.
We also have a new quoted HTML parser that finds trailing quotes.
Fixes T2335
Test Plan: lots of new quoted text tests
Reviewers: bengotow
Reviewed By: bengotow
Maniphest Tasks: T2335
Differential Revision: https://phab.nylas.com/D1773
Summary:
There are now two objects, Folders & Labels. These inherit from `Category`
(that's what Eben said they were using on the backend).
There are two separate tasks.
1. MoveToFolderTask
2. ApplyLabelsTask
It turns out that the semantics between the two are quite different.
The reverse operation for moving to a folder is a bit tricky.
As of 7-8-15, the Tasks are pretty much complete. I need to write tests
for them still and do some manual testing in the client.
Test Plan: Writing specs
Reviewers: bengotow
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D1724
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