Commit graph

39 commits

Author SHA1 Message Date
Ben Gotow 215fa0e4cb fix(initial-sync): When an error is encountered, do not start fetching from zero again
Summary:
Previously, when an error was encountered during initial mailbox sync we just started it
over after a retry delay. Recent API uptime issues mean that this was happening often and lots of
people were seeing sync retry many times. This is bad because the app is less performant while
it's syncing mail, and also generates unnecessary load as the app re-fetches threads it already has.

In this diff, there are new specs and functionality in nylas-sync-worker to start fetching
where we left off. This is typically going to be OK because the default sort ordering of the
threads endpoint is newest->oldest, so if new items have arrived since we started fetching
and page boundaries have changed, we'll get duplicate data rather than missing data. Connceting
to the streaming API as soon as we start the sync also ensures that we roll up any changes to
data we've already paginated over.

Test Plan: Run tests

Reviewers: drew, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2132
2015-10-08 19:02:54 -07:00
Ben Gotow fe06835540 fix(notifications): Add a purple tint color for developer notification 2015-10-04 00:22:59 -07:00
Ben Gotow cff7f8834e feat(plugins): Restore the plugins sidebar view 2015-10-03 18:11:36 -07:00
Ben Gotow d5a5cdd4eb switch(env): Move N1 to Nylas production API 2015-10-02 15:01:31 -07:00
Ben Gotow f44f84a583 fix(task-counts): In the activity box, show "Moving to folder... (4) = threads not task counts
Test Plan: Run tests

Reviewers: dillon, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2087
2015-09-30 09:54:14 -07:00
Ben Gotow 4e300015b5 fix(react-keys): ActivitySidebar had a few missing component keys 2015-09-30 00:35:45 -07:00
Ben Gotow 1a0292a37e fix(docs): Replace docs references to Edgehill with N1 2015-09-29 09:45:02 -07:00
Ben Gotow 7041ec1764 fix(delta-activity): Make the loading spinner slightly smaller 2015-09-28 01:37:25 -07:00
Ben Gotow c73bc940b9 fix(activity-sidebar): Minor style tweaks - CSS selectors for a few things were not in use 2015-09-24 15:32:23 -07:00
Evan Morikawa 17c6fd6e78 feat(sync): expanded details on sync status
Summary: Fixes T3574

Test Plan: manual

Reviewers: dillon, bengotow

Reviewed By: dillon, bengotow

Maniphest Tasks: T3574

Differential Revision: https://phab.nylas.com/D2058
2015-09-24 11:03:11 -07:00
dillon 3d84c41625 fix(activity-sidebar): render correct copy on only correct moments
Summary:
fixes T3725

changes:
- show the sync mail activity only if number of deltas received is greater than 10
- make the sync mail activity notification persist for longer, since large deltas (>1k) come in intervals of about 25 seconds, which was greater than our previous timeout interval of 15 seconds
- change to clearer copy
- minor style changes to match new copy

Test Plan: tested manually

Reviewers: bengotow

Maniphest Tasks: T3725

Differential Revision: https://phab.nylas.com/D2051
2015-09-22 14:05:26 -07:00
dillon 6608b21da9 fix(NUX): show when initial sync is taking place
Summary:
fixes T3563

todo
[x] check with @bengotow and @evan -- does this solution make sense to you?
[x] decide on the actual visual cue to the user -- @bengotow you suggested a loader or spinner, but i was thinking that actual copy should be used so it doesn't look like an unhelpful spinner which goes indefinitely. what do you think of the copy here?
[ ] implement spinner similar to sending a draft
[ ] write tests
[ ] verify that we're showing progress in a helpful way

problem
- new users would see nothing in edgehill after they log in, with no indication on why they can't see any of their mail
- in actuality, our backend is actively pulling all their mail to serve it to edgehill
- new users think edgehill is broken because they're unaware of the work that our backend was doing

solution
- when the backend sends deltas to edgehill, we show a message in the activity bar saying that we're trying to get their mail
- we'll show the sync progress

Test Plan: still need to add tests. all previous tests still green.

Reviewers: bengotow, evan

Subscribers: sdw, bengotow, evan

Maniphest Tasks: T3563

Differential Revision: https://phab.nylas.com/D2032
2015-09-18 16:15:15 -07:00
dillon 00839e37aa feat(account-sidebar): mail activity box now transitions in and out. fixes T3519.
Test Plan: tested manually, all tests still green

Reviewers: evan, bengotow

Reviewed By: bengotow

Maniphest Tasks: T3572, T3519

Differential Revision: https://phab.nylas.com/D2014
2015-09-14 11:04:24 -07:00
Evan Morikawa 3908ba402d feat(sync): Resume sync worker action from sidebar 2015-08-28 16:24:39 -04: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 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
Ben Gotow 58a9d60ce1 fix(specs/keys): Fix broken specs, clean up CJSX 2015-08-06 12:22:06 -07:00
Evan Morikawa 93ea9c6165 fix(*): can select participant with space if it's an email
Summary:
Fixes T2272

If the label is too long, the unread icons will now ellipsis truncate the
text correctly instead of being pushed off of the side.

I made the max-width of the sidebar 17px wider to allow for Karim's french
"Inbox" translation.

Fixes T2266

Added some more protection to places where filenames could be blank when
downloading.

This was partially fixed by Rob's D1685

Fixes T2258

You can now finish selecting a participant by pressing `space`, but only
when the participant looks like an email address.

When you do this we directly add the email address to the chip instead of
looking up a contact. This allows you to send just to the email instead of
adding a potentially erroneous name into the input field

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Maniphest Tasks: T2272, T2266, T2258

Differential Revision: https://phab.nylas.com/D1729
2015-07-13 10:25:30 -04:00
Ben Gotow 672354260e fix(nylas-api): Globally handle 401s and notify user they need to sign in
Summary: Fixes T1843

Test Plan: No tests for this file yet

Reviewers: evan

Reviewed By: evan

Maniphest Tasks: T1843

Differential Revision: https://phab.nylas.com/D1641
2015-06-17 12:29:49 -07:00
Ben Gotow 2b324c4533 feature(package-management): Package management interface, APM integration
Summary:
Update a few more packages to deactivate properly

Miscelaneous fixes

Initial commit of new settings package

WIP

WIP - can load and unload and install / uninstall

Click to create new boilerplate package, package updating

Test Plan: Run tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1582
2015-06-02 19:04:21 -07:00
Evan Morikawa e32a7fe065 Removed invalid Action.notificationDismissed firing
Summary:
If a notification is dismissed manually, the setInterval dismissal is still fired.
         This patch adds a check and removes the notification dismissal action from firing

Test Plan: none

Reviewers: ktalwar, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1218
2015-05-27 12:31:07 -04:00
Ben Gotow 789228e8f2 fix(notifications): Give notifications tag like HTML5 Notifications so you can de-dupe 2015-05-25 10:27:36 -07:00
Ben Gotow 310f8ba062 fix(mailto): Handle mailto on application launch, populate NamespaceStore synchronously
Summary:
atom-window `sendMessage` was not the same as `browserWindow.webContents.send`. WTF.

Save current namespace to config.cson so that it is never null when window opens

Don't re-create thread view on namespace change unless the namespace has changed

Tests for NamespaceStore state

Push worker immediately in workerForNamcespace to avoid creating two connections per namespace

Allow \n to be put into sreaming buffer, but only one

Clear streaming buffer when we're reconnecting to avoid processing same deltas twice (because of 400msec throttle)

Make `onProcessBuffer` more elegant—No functional changes

Test Plan: Run tests!

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1551
2015-05-21 18:08:29 -07:00
Ben Gotow 92cf2d520c fix(asar): Support ASAR, and running of specs in prod builds
Summary:
fix(task-queue): Repair the findTask function

Add "ship logs" and "open logs" to the developer menu

Patches for Chromium 42

Test Plan: Run tests!

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1547
2015-05-21 14:41:30 -07:00
Evan Morikawa 4619871e8d refactor(utils): switch to regular underscore
Summary:
Fixes: T1334

remove final InboxApp references

move out all underscore-plus methods

Mass find and replace of underscore-plus

sed -i '' -- 's/underscore-plus/underscore/g' **/*.coffee
sed -i '' -- 's/underscore-plus/underscore/g' **/*.cjsx

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1534
2015-05-19 16:06:59 -07:00
Ben Gotow 3af6c45387 fix(initial-sync): Make initial sync more robust, show progress, retry on failure
Summary:
Rename ActivityBar => DeveloperBar

Expose sync workers and make them observable

New activity sidebar that replaces momentary notifications

Updated specs

Test Plan: Run new specs!

Reviewers: evan

Reviewed By: evan

Maniphest Tasks: T1131

Differential Revision: https://phab.nylas.com/D1521
2015-05-19 15:59:37 -07:00
Ben Gotow 91edef9f7a fix(naming): Move atom/inbox/nilas refs to Nylas
Conflicts:
	internal_packages/inbox-activity-bar/lib/activity-bar-long-poll-item.cjsx
2015-05-15 11:07:28 -07:00
Ben Gotow 9ffe0d74dd feat(unsafe-components): Wrap injected components, catch exceptions, clean up ComponentRegistry
Summary:
This diff gives the ComponentRegistry a cleaner, smaller API. Instead of querying by name, location or role,
it's now just location and role, and you can register components for one or more location and one or more
roles without assigning the entries in the registry separate names.

When you register with the ComponentRegistry, the syntax is also cleaner and uses the component's displayName
instead of requiring you to provide a name. You also provide the actual component when unregistering, ensuring
that you can't unregister someone else's component.

InjectedComponent and InjectedComponentSet now wrap their children in UnsafeComponent, which prevents
render/component lifecycle problems from propogating.

Existing components have been updated:

1. maxWidth / minWidth are now containerStyles.maxWidth/minWidth
2. displayName is now required to use the CR.
3. containerRequired = false can be provided to exempt a component from being wrapped in an UnsafeComponent.
   This is useful because it's slightly faster and keeps DOM flat.

This diff also makes the "Show Component Regions" more awesome. It displays column regions, since they now
use the InjectedComponentSet, and also shows for InjectedComponent as well as InjectedComponentSet.

Change ComponentRegistry syntax, lots more work on safely wrapping items. See description.

Fix for inline flexbox scenarios (message actions)

Allow ~/.inbox/packages to be symlinked to a github repo

Test Plan: Run tests!

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1457
2015-04-30 16:10:15 -07:00
Evan Morikawa e3dfbe59be refactor(react): convert to class-based React components
Summary: Fix react upgrade errors

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://review.inboxapp.com/D1456
2015-04-30 13:08:29 -07:00
Ben Gotow d9ee12cf81 refactor(*): Thread list fixes, flexible workspace store, multiple root sheets
Summary:
Remember to remove all the event listeners added to email frame

New files tab, queryable filename, not attribute

Rename ThreadSelectionBar to RootSelectionBar to go with RootCenterComponent, make it appear for draft selection and file selection as well

Initial file list and file list store, File Location

Remove unnecessary shouldComponentUpdate

Always track whether new requests have happened since ours to prevent out of order triggers

Always scroll to the current [focused/keyboard-cursor] in lists

So goodbye to the trash tag

Only scroll to current item if focus or keyboard has moved

Show message snippet in notification if no subject line

Make the RootSelectionBar pull items from Component Registry

New Archive button (prettier than the other one)

Refactor event additions to iframe so iframe can be used for file display also

Thread List is no longer the uber root package - drafts and files moved to separate packages

WorkspaceStore now allows packages to register sheets, "view" concept replaced with "root sheet" concept, "mode" may not be observed by all sheets, and is now called "preferred mode"

Don't animate transitions between two root sheets

Mode switch is only visible on root sheets that support multiple modes

Account sidebar now shows "Views" that have registered themselves: drafts and files for now

Model Selection Bar is now a component, just like ModelList. Meant to be in the toolbar above a Model List

Misc supporting changes

New files package which registers it's views and components

Rename files package to `file-list`

Move checkmark column down into model list

Don't throw exception if shift-down arrow and nothing selected

Takes a long time on login to fetch first page of threads, make pages smaller

Displaynames, spec fixes

Test Plan: Run tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1412
2015-04-10 14:33:05 -07:00
Ben Gotow d1fec8b789 fix(speed): Mark packages as engine:atom, don't include coffee,cjsx in compiled app 2015-03-20 17:53:11 -07:00
Ben Gotow 21e8455ef6 refactor(layout): More configuration into WorkspaceStore, less in packages 2015-03-20 14:52:10 -07:00
Ben Gotow 34facc920f fix(sheets): Move toolbar, re-introduce :Top region, refactor sheet layout
Summary:
Debounce Component Registry trigger to make app launch much more efficient

Allow arbitrary additional attributes to be set on flexbox, resizable-region

Updates to notification styling

Sheet store maintains an array of sheet types3 instead of sheet elements

Search bar and composer new should be globally visible

Toolbar is now in sheet container instead of individual sheet columns

The sheet container monitors sheet column width and manually positions toolbars

Test Plan: No new tests yet - will see if this design sticks first.

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1287
2015-03-12 15:07:38 -07:00
Evan Morikawa 8b2797d3b0 feat(notifications): move to sidebar
Summary: feat(notifications): move to sidebar

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://review.inboxapp.com/D1282
2015-03-11 13:17:11 -07:00
Evan Morikawa 6ec84561c4 feat(composer): popout only closes when message sending succeeds
Summary:
This is a WIP to fix the blatant case of messages dissapearing when
there's an error. It's pending a better through through notification UI

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://review.inboxapp.com/D1270
2015-03-10 09:52:47 -07:00
Ben Gotow 343e592569 feat(draft-list) Refactor thread-list, create draft-list
Summary: Adds the draft list using a refactored list-tabular class. Also fixes several draft bugs that appeared after allowing editing.

Test Plan: Run tests (need to test new ListTabular component ASAP)

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1272
2015-03-09 18:25:53 -07:00
Ben Gotow e5975b2acc fix(packages): Update other packages to new UI 2015-03-05 17:56:45 -08:00
Evan Morikawa b63aad83f1 more UI variable improvements 2015-03-03 12:24:48 -08:00
Ben Gotow 1e8fd46342 fix(drafts): Various improvements and fixes to drafts, draft state management
Summary:
This diff contains a few major changes:

1. Scribe is no longer used for the text editor. It's just a plain contenteditable region. The toolbar items (bold, italic, underline) still work. Scribe was causing React inconcistency issues in the following scenario:
   - View thread with draft, edit draft
   - Move to another thread
   - Move back to thread with draft
   - Move to another thread. Notice that one or more messages from thread with draft are still there.

There may be a way to fix this, but I tried for hours and there are Github Issues open on it's repository asking for React compatibility, so it may be fixed soon. For now contenteditable is working great.

2. Action.saveDraft() is no longer debounced in the DraftStore. Instead, firing that action causes the save to happen immediately, and the DraftStoreProxy has a new "DraftChangeSet" class which is responsbile for batching saves as the user interacts with the ComposerView. There are a couple big wins here:

   - In the future, we may want to be able to call Action.saveDraft() in other situations and it should behave like a normal action. We may also want to expose the DraftStoreProxy as an easy way of backing interactive draft UI.

   - Previously, when you added a contact to To/CC/BCC, this happened:

     <input> -> Action.saveDraft -> (delay!!) -> Database -> DraftStore -> DraftStoreProxy -> View Updates

Increasing the delay to something reasonable like 200msec meant there was 200msec of lag before you saw the new view state.

To fix this, I created a new class called DraftChangeSet which is responsible for accumulating changes as they're made and firing Action.saveDraft. "Adding" a change to the change set also causes the Draft provided by the DraftStoreProxy to change immediately (the changes are a temporary layer on top of the database object). This means no delay while changes are being applied. There's a better explanation in the source!

This diff includes a few minor fixes as well:

1. Draft.state is gone—use Message.object = draft instead
2. String model attributes should never be null
3. Pre-send checks that can cancel draft send
4. Put the entire curl history and task queue into feedback reports
5. Cache localIds for extra speed
6. Move us up to latest React

Test Plan: No new tests - once we lock down this new design I'll write tests for the DraftChangeSet

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1125
2015-02-03 16:24:31 -08:00