Commit graph

449 commits

Author SHA1 Message Date
Ben Gotow 7826ed99f8 fix(iframe-resize): Subscribe to iframe window resize, adjust container height
Summary: Fixes T2095, iFrames resize when images load, when container is resized, etc.

Test Plan: Run tests

Reviewers: dillon, evan

Reviewed By: dillon, evan

Maniphest Tasks: T2095

Differential Revision: https://phab.nylas.com/D1964
2015-09-01 16:23:29 -07:00
Ben Gotow 7014a450ce fix(db): Add index for draft count query, use sqlite timing profiler and log queries >100msec 2015-09-01 15:35:06 -07:00
Ben Gotow 434c5822a2 fix(specs): Lazily require CategoryStore to fix broken tests 2015-09-01 15:32:36 -07:00
dillon 629ed5f7b2 fix(thread): thread.sortLabels() now ignores 'Sent Mail' and other unnecessary labels. fixes T3454.
Summary: NOTE: this ticket and this diff do not address turning the 'Important' label into a more user-friendly chevron. I created T3477 for that.

Test Plan: added more tests. however, seems like somebody merged some tests which are failing.

Reviewers: bengotow, evan

Reviewed By: evan

Maniphest Tasks: T3454

Differential Revision: https://phab.nylas.com/D1963
2015-09-01 14:47:22 -07:00
Ben Gotow a366f13d9a fix(db): Use recommended page-size, cache size. Allow 80MB in RAM cache 2015-09-01 13:35:30 -07:00
Ben Gotow ac96110f1f fix(windows): Fix old references to windowManager 2015-09-01 12:14:15 -07:00
Evan Morikawa 31714407f9 feat(composer): sanitizes and inlines CSS styles for replies and fwd 2015-09-01 11:53:38 -07:00
Evan Morikawa 7ffaf6c17f fix(sidebar): fix case when category comes back as null 2015-09-01 06:18:11 -07:00
Evan Morikawa 3ec33b938a fix(mailto): fix incorrect calling of draft popout from mailto 2015-09-01 06:05:52 -07:00
Evan Morikawa 13629f57dc fix(preferences): add window title to preferences
Fixes T3458 Preferences panel shows up as "Electron" in Window menu
2015-08-31 17:25:33 -07:00
Evan Morikawa cb72438270 fix(regex): allow "=" in valid email address
Fixes T3440 Email formatting validation bug
2015-08-31 15:48:39 -07:00
Evan Morikawa 760311f1fc feat(work-window): give work window a standard toolbar
Fixes T3457 "Activity" window needs a close affordance
2015-08-31 15:43:47 -07:00
Ben Gotow a0aaadd91f fix(file-uploads): Critical fix to bad method call to session.draft instead of session.draft() 2015-08-30 20:18:05 -07:00
Ben Gotow 873c9379f4 fix(file-uploads): Do not store the draft session and draft during upload 2015-08-30 20:17:16 -07:00
Evan Morikawa a0307d4d88 fix(uploads): no more from picker & uploads use correct accountId
Test Plan: edgehill --test

Reviewers: dillon, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1955
2015-08-28 20:35:43 -04:00
Ben Gotow d0dcfb8359 fix(keyboard-cursor): Recent optimization broke keyboard cursor advancing fast 2015-08-28 14:34:56 -07:00
Evan Morikawa 3908ba402d feat(sync): Resume sync worker action from sidebar 2015-08-28 16:24:39 -04:00
Ben Gotow 944d6a8e1e fix(send-draft): Update the draft rather so it's clientId is maintained, even if the ID has changed on send 2015-08-28 13:19:09 -07:00
Ben Gotow 3626beb294 fix(nylas-api): When receiving models, ignore changes that would make non-drafts into drafts 2015-08-28 13:04:40 -07:00
Ben Gotow 9247a41292 fix(specs): Future specs should stub DatabaseStore.run, not find/findBy 2015-08-28 12:41:56 -07:00
Ben Gotow 5e0ef3946c fix(atom): Put displayWindow back - it's used in other places 2015-08-28 12:25:48 -07:00
Ben Gotow 912075a6f9 fix(model-observation): Watch for changes to objects with matching clientIds, since server id may be assigned 2015-08-28 12:25:48 -07:00
Ben Gotow 82f0ffd13c fix(sending): Since we have a unique index on clientId, no need to delete draft after sending 2015-08-28 12:25:48 -07:00
Evan Morikawa a0e64bf580 refactor(packages): Remove Edgeforce 2015-08-28 15:16:32 -04:00
Evan Morikawa 700ade2936 fix(database): report if database errors on setup 2015-08-28 14:44:40 -04:00
Ben Gotow 3e435fc5a5 fix(draft): Always retrieve draft body when using clientId 2015-08-28 11:43:30 -07:00
Ben Gotow 7190ca69f7 refactor(db): change ID system to have clientIDs and serverIDs
Summary: Major ID refactor

Test Plan: edgehill --test

Reviewers: bengotow, dillon

Differential Revision: https://phab.nylas.com/D1946
2015-08-28 11:24:29 -07:00
Ben Gotow 1a576d92dc feat(work): Create the "Work" window, move TaskQueue, Nylas sync workers
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
2015-08-27 16:39:40 -07:00
Ben Gotow 41a3529f16 fix(perf): Apply accountId to more queries, always run query plans in dev mode to flag SCANs 2015-08-26 14:10:28 -07:00
Ben Gotow f33035cfc3 fix(change-mail-task): Ignore 404s when changing mail so that we don't attempt to roll back and re-create purged objects + spec 2015-08-26 11:54:03 -07:00
Ben Gotow 91774668eb fix(delta-sync): Properly look up model types, add specs for all this logic
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
2015-08-26 11:43:10 -07:00
Ben Gotow 6670d10ee4 fix(T3427): Trying to deserialize dropped contacts using the registry fails because they were not serialized with the registry
Summary:
Fixes T3427

Use the more generic serialize registered objects instead of the DatabaseObjectRegistry directly.

Fix a bug in the serialize function that was preventing it from inflating the top level object if it had a constructorName.

Remove contact checks because tokenizing-test-field is generic. Participant text field checks type.

Hot new drag and drop integration test

Test Plan: Run new test (<3 react)

Reviewers: dillon, evan

Reviewed By: dillon, evan

Maniphest Tasks: T3427

Differential Revision: https://phab.nylas.com/D1933
2015-08-26 10:07:23 -07:00
Ben Gotow 9146df086e fix(before-unload): When drafts are present, we do not resume quit properly after committing changes
Summary:
We designed the onBeforeUnload handler to resume a "close window" event, but it actually needs to resume a quit as well. This has become an issue recently and may be due to the DraftStore sessions not being removed from the DraftStore.

To test: Create a popout draft, close it, and then try to quit the app.

Test Plan: Run updated tests

Reviewers: dillon, evan

Reviewed By: dillon, evan

Differential Revision: https://phab.nylas.com/D1932
2015-08-26 10:00:20 -07:00
Ben Gotow 6c407f2f1c fix(config): Apply config change from Atom, process locking
Summary:
d1c44dcb54

Also lock config across processes to prevent the user from being logged out when the main process reads config before it's finished writing. This is what is causing the login window to appear.

Test Plan: Rapidly tap between the two display modes. Note that it no longer reverts to the wrong one intermittently.

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1931
2015-08-25 16:00:09 -07:00
Ben Gotow 0330dbbc22 fix(draft-account-switching): Need to totally delete draft threadId and replyToMessageId 2015-08-25 12:23:27 -07:00
Ben Gotow 27181d177e fix(sentry-2523): Console.warning is not a method 2015-08-25 11:45:07 -07:00
Ben Gotow c1cf4445df fix(mixpanel): Correctly associate events with distinct_ids 2015-08-25 11:33:36 -07:00
Ben Gotow 78a02ad52c fix(button-dropdown): Broken styles on reply/reply-all button dropdown 2015-08-24 17:31:03 -07:00
Ben Gotow 2e1e485051 fix(database): Allow findVersions to be called with more than 250 items 2015-08-24 14:01:31 -07:00
Ben Gotow e4b8db16f4 fix(task-queue): Rename the task queue file to avoid upgrade issues 2015-08-24 10:51:50 -07:00
Ben Gotow d5b07511db fix(add-account): Don't check for tokens from secondary windows 2015-08-21 18:23:24 -07:00
Ben Gotow 0c57108ff2 fix(object-serialization): Constrain use of __constructorName, fix infinite recursion, remove hackiness 2015-08-21 16:08:24 -07:00
Ben Gotow 81d2edcaf9 feat(accounts): Kill namespaces, long live accounts
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
2015-08-21 15:29:58 -07:00
Evan Morikawa 23c8466fe0 fix(message): update MessageBodyProcess to key on message version 2015-08-20 16:44:13 -07:00
Evan Morikawa e2af724fa2 fix(thread): fix bug whereby thread list blows up if no "from" 2015-08-20 16:21:47 -07:00
Evan Morikawa c48bb3f8f2 refactor(models): Enables 3rd party plugins to add Models & Tasks
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
2015-08-19 16:25:56 -07:00
Evan Morikawa 06a1eb42b2 fix(iframe): catch relative and malformed uris
Summary:
Fixes T3252

When links were clicked with malformed, relative, or malicious href links
we'd perform default behavior instead of catching them.

If you have href="www.foo.bar" the browser by default thinks it's a
relative link. In our case it would prepend the full default base URI
which is file://path/to/edgehill. This would at best fail to do anything
and at worst execute an arbitrary file.

We now blacklist `file:` and check for the existence of a valid RFC 3986
schema on the URI.

Test Plan: manual

Reviewers: bengotow

Reviewed By: bengotow

Maniphest Tasks: T3252

Differential Revision: https://phab.nylas.com/D1888
2015-08-19 10:20:41 -07:00
Ben Gotow fd08bf87b0 fix(keymaps): JSON => CSON during cibuild final phase 2015-08-18 14:50:53 -07:00
dillon db407abbde add more test coverage and refactor checking if a contact is the current user. fixes T3360.
Summary: @evan -- would love to get your opinion on this approach!

Test Plan: add new tests

Reviewers: evan

Reviewed By: evan

Subscribers: evan

Maniphest Tasks: T3360

Differential Revision: https://phab.nylas.com/D1904
2015-08-18 10:18:30 -07:00
Ben Gotow 3e43f45401 perf(drafts): Cache results of running Autolinker, avoid props.children for EmailFrame, fix special case for new draft
Summary:
"results.length" not "result.length".

Eventually I want MessageBodyProcessor to be the public interface to another process which asynchronously runs message body parsing? At the very least, caching the results means that miscelaneous refreshes to the message list don't incur significant string processing cost.

Test Plan: No new tests here

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1898
2015-08-17 16:23:12 -07:00