Commit graph

887 commits

Author SHA1 Message Date
Evan Morikawa 9707092cc9 Add logger fallback 2016-11-23 10:53:02 -08:00
Karim Hamidou ba58409f2c Fix module loading bug
Conflicts:
	packages/isomorphic-core/src/models/index.js
	packages/local-sync/package.json
2016-11-23 10:51:03 -08:00
Juan Tejada dcb78302b8 fix loadModels 2016-11-23 10:32:46 -08:00
Evan Morikawa 2cce4e0d7d Add sqlite3 since sequelize can't use better-sqlite3 2016-11-23 10:32:07 -08:00
Evan Morikawa 4eacd22846 Fix JSON parsing error 2016-11-23 10:19:35 -08:00
Evan Morikawa ae42c37606 Add better-sqlite3 2016-11-23 10:18:47 -08:00
Juan Tejada 5b7214e464 [local-sync]: Let local-sync start, add loadModels to iso-core 2016-11-23 10:18:35 -08:00
Evan Morikawa 3fac21458c Update local port to 2578 2016-11-23 10:12:02 -08:00
Evan Morikawa cd65135feb [isomorphic-core] add trailing ./ 2016-11-23 09:34:38 -08:00
Evan Morikawa 0793e97f33 [*] package.json updates post lerna bootstrap 2016-11-23 09:33:54 -08:00
Evan Morikawa 1112d3bccd [local-sync] update package.json to include missing deps 2016-11-23 09:27:41 -08:00
Evan Morikawa c3cca9f518 [isomorphic-core] Remove packages no longer used in isomorphic-core 2016-11-23 09:12:59 -08:00
Evan Morikawa b5bf4e07c4 [isomorphic-core] Move files into src folder for isomorphic-core 2016-11-23 09:12:54 -08:00
Evan Morikawa 21977a25ca [isomorphic-core] Rename nylas-core -> isomorphic-core 2016-11-23 09:12:50 -08:00
Evan Morikawa d01b4ffe77 [isomorphic-core] Uppdate refs nylas-core => isomorphic-core 2016-11-23 09:12:45 -08:00
Juan Tejada 814e014e39 Final nylas-core and cloud-core cleanup
- Remove unused exported PromiseUtils from cloud-core, import instead
from nylas-core where needed
- Remove unused MessageTypes from cloud-core
- Move MessageTypes from nylas-core to local-sync. It's completely
isolated to local-sync
2016-11-22 20:36:38 -08:00
Juan Tejada 3b7c40a870 [local-sync] Misc fixes from database-connector move 2016-11-22 20:25:43 -08:00
Juan Tejada 792ed2bb5c local[sync] Move missing file for local-syncs database-connector 2016-11-22 20:18:19 -08:00
Juan Tejada 0a24c01b5a [local-sync] fix path for local pubsub-connector 2016-11-22 20:13:35 -08:00
Juan Tejada 957ba73bd0 [local-sync] Make local logger es6 for compilation 2016-11-22 20:10:54 -08:00
Juan Tejada 296846adf5 [local-sync] Remove logger and metrics from local-sync and nylas-core 2016-11-22 20:07:11 -08:00
Evan Morikawa 3ff98f45a9 Rename generic Errors to IMAPErrors 2016-11-22 18:24:46 -08:00
Evan Morikawa 65fafc0390 Move SyncPolicy out of nylas-core to DefaultSyncPolicy 2016-11-22 18:20:34 -08:00
Evan Morikawa 106d7e57a1 Rename DatabaseConnector to LocalDatabaseConnector and move 2016-11-22 17:51:43 -08:00
Evan Morikawa 2b1c787eec Move PubSubConnector to LocalPubSubConnector out of nylas-core 2016-11-22 17:51:43 -08:00
Evan Morikawa c019e9a23b Move SchedulerUtils out of nylas-core to local-sync/src/shared 2016-11-22 17:07:48 -08:00
Juan Tejada 008a294242 fix(deps) Fix deps for local-sync and nylas-core 2016-11-22 16:55:08 -08:00
Evan Morikawa 951feae657 [local-sync]: moved spec into similarly named folder and updated refs 2016-11-22 16:08:10 -08:00
Evan Morikawa 9e867fa4fd [local-sync]: move folders into src folder 2016-11-22 16:03:38 -08:00
Ben Gotow 18c0ff40ba [cloud] fix(*): More misplaced packages 2016-11-22 15:40:18 -08:00
Evan Morikawa 25cca505b7 Moved cloud-metrics into cloud-core 2016-11-22 15:34:00 -08:00
Evan Morikawa e772e11196 [local]: rename folder nylas-api to local-api 2016-11-22 15:34:00 -08:00
Halla Moore 845139826b [local-sync] Check for missing Category roles by localized display names
Sometimes imap mailboxes aren't properly flagged with their roles, so we
check the display names against known variations to see if we can find any
missing roles.
2016-11-22 15:31:35 -08:00
Juan Tejada 5e42a7dd9e Merge branch 'master' of github.com:nylas/K2 2016-11-22 15:16:00 -08:00
Ben Gotow 1ec3c2e162 [cloud] fix(*): remove all traces of loggly 2016-11-22 15:13:48 -08:00
Juan Tejada 637d3ac6cc fix local-sync package 2016-11-22 15:13:28 -08:00
Evan Morikawa d4608dd3a6 Update package.json post lerna install 2016-11-22 14:52:42 -08:00
Karim Hamidou 372beeef52 More structure adapts.
Conflicts:
	packages/local-sync/package.json
2016-11-22 14:26:48 -08:00
Karim Hamidou 4d91dcd3a3 Basic structure changes to run K2 in N1 2016-11-22 14:23:16 -08:00
Ben Gotow 424ee4e1d2 [local] Fix package json 2016-11-22 13:55:04 -08:00
Karim Hamidou 0c5dd6ded7 Flesh out skeleton. 2016-11-22 12:25:27 -08:00
Juan Tejada ddd5641463 fix(folders): Properly update thread folders on sync 2016-11-22 12:24:13 -08:00
Karim Hamidou 3d31150bbb (fix) Set up base structure for local sync. 2016-11-22 12:01:45 -08:00
Ben Gotow 27ba2544dd Pull in cloud packages 2016-11-22 10:58:27 -08:00
Juan Tejada f2dbb2144b feat(labels): Add functioning endpoint for updating labels for messages & threads
- This commit also correctly sets the labels on the corresponding thread
whenever a message has its labels updated
- Fix removing labels from messages
2016-11-22 09:58:41 -08:00
Juan Tejada 45d682c957 feat(api): Can now set labels for messages 2016-11-21 17:41:57 -08:00
Evan Morikawa 1b1d356753 fix(package): re-order package.json files 2016-11-21 17:07:52 -08:00
Juan Tejada eba33080ac fix(messages): Fix raw message api endpoint 2016-11-21 14:36:54 -08:00
Ben Gotow 8efd4f7935 Fix another linter issue 2016-11-21 14:05:38 -08:00
Ben Gotow e87e67cea3 Fix linter issues 2016-11-21 14:00:35 -08:00
Halla Moore 7906e3303d Add placeholders for various routes that N1 uses. 2016-11-21 13:50:34 -08:00
Halla Moore 0fe6343137 Remove filtering from the collection APIs.
Affected collections were categories, contacts, files, messages, and threads.
2016-11-21 13:50:29 -08:00
Ben Gotow e10e51ab5d A few changes to support linking to K2 via the new GUI 2016-10-11 00:44:10 -07:00
Ben Gotow f9f78968b1 Use defaultValue as a template, fix critical sync issue 2016-07-15 19:01:50 -07:00
Ben Gotow 549ced6128 Revert change, @evan’s fix is better 2016-07-15 16:28:13 -07:00
Ben Gotow 18a8e5f09a Merge branch 'master' of ssh://github.com/nylas/k2 2016-07-15 16:25:21 -07:00
Ben Gotow 7efe5db7e9 USE_CONSOLE_LOG for simple console logs 2016-07-15 16:25:18 -07:00
Halla Moore 8140076e17 Remove auto-scaling for the collapsed dashboard view, at least for now. 2016-07-15 16:09:17 -07:00
Ben Gotow 5095f0626f Merge branch 'master' of ssh://github.com/nylas/k2 2016-07-15 13:29:25 -07:00
Halla Moore 0dad9bf7fa Auto-scale MiniAccounts in the collapsed, ungrouped dashboard view 2016-07-15 13:20:09 -07:00
Evan Morikawa dffb87bd4a Report errors earlier 2016-07-15 13:15:26 -07:00
Evan Morikawa 5e0bcc5eff Quieter logging on dev 2016-07-15 13:07:12 -07:00
Ben Gotow e13097045b Log boxname and category name as well 2016-07-15 12:39:28 -07:00
Halla Moore 0abd70c746 Add option to group by process in collapsed dashboard view 2016-07-15 12:31:07 -07:00
Ben Gotow 579fe43fdf Log when recovering from uidvalidity, don’t do it on first sync 2016-07-15 11:47:26 -07:00
Ben Gotow 95793877c6 Do file creation in a transaction, and with fewer saves 2016-07-15 11:14:35 -07:00
Ben Gotow e5bada04d3 Do contact insertion in a transaction 2016-07-15 10:23:01 -07:00
Ben Gotow 979401883d Make db connection pools smaller 2016-07-15 10:22:49 -07:00
Ben Gotow ac3f96e2d4 Fix accounts syncing in a hard loop due to redis loopback 2016-07-15 10:07:33 -07:00
Ben Gotow 13a723e663 Correctly detect condstore to lower db load 2016-07-15 09:46:31 -07:00
Ben Gotow 13879db9c8 Wait until tables are created before queueing sync 2016-07-14 19:32:13 -07:00
Ben Gotow 08c7ca8b0d Use EC2 instance ID instead of hostname 2016-07-14 18:52:30 -07:00
Ben Gotow 5062f8d02b Sort process ids 2016-07-14 18:33:46 -07:00
Ben Gotow 1996666516 Merge branch 'master' of ssh://github.com/nylas/k2 2016-07-14 18:18:54 -07:00
Ben Gotow daaa67818d Add missing unique indexes, only create tables when authing account 2016-07-14 18:18:48 -07:00
Halla Moore 6e2ae25519 Add a sum line to the dashboard's process load counts 2016-07-14 18:01:52 -07:00
Evan Morikawa 45f132b746 Fix thread moving to support new Promises 2016-07-14 17:37:38 -07:00
Ben Gotow a229ba1a90 Sort process entries on the dashboard 2016-07-14 17:34:33 -07:00
Ben Gotow 1ce7787632 Disable sequelize logging 2016-07-14 17:21:21 -07:00
Ben Gotow 1d08faece3 Fixes to still support sqlite 2016-07-14 17:21:02 -07:00
Ben Gotow 2f3ca2a906 Merge branch 'master' of ssh://github.com/nylas/k2
# Conflicts:
#	packages/nylas-core/hook-transaction-log.js
#	packages/nylas-core/models/account/transaction.js
2016-07-14 17:17:22 -07:00
Ben Gotow de3151cab4 Move to single database with many tables for accts 2016-07-14 17:14:16 -07:00
Evan Morikawa 1eef4c3428 Remove logs and rename variables 2016-07-14 16:36:13 -07:00
Annie 5b3f5c8a91 fixed thread syncing 2016-07-14 16:28:09 -07:00
Ben Gotow ea497f7ea2 A few changes for upcoming db refactoring 2016-07-14 15:48:48 -07:00
Halla Moore b14d5f7e8d Add process load counts to the dashboard 2016-07-14 14:51:54 -07:00
Juan Tejada 099e200ec5 Only log sync errors if they are permanent errors 2016-07-14 13:44:43 -07:00
Juan Tejada 37b2323cc7 Add metric for sync errors 2016-07-14 12:00:05 -07:00
Evan Morikawa 0921df432b Uses default from address 2016-07-14 11:40:46 -07:00
Evan Morikawa 6ce54c2a34 Add send endpoint 2016-07-14 11:34:30 -07:00
Juan Tejada b58c11605c Moves metrics into its own pkg to be able to instrument other services
- With the Metrics module inside nylas-core, and bc of our current lerna
setup, we required other modules like sequelize and redis before requiring
newrelic, thus preventing them from being properly instrumented
2016-07-14 11:20:58 -07:00
Juan Tejada 592b2af986 Update metric type for accounts_syncing_count 2016-07-14 10:49:40 -07:00
Juan Tejada 16b91ea394 Update metrics with signalfx - report # of syncing accts per host 2016-07-14 10:39:05 -07:00
Juan Tejada 0c900b072d Add new relic to all pkgs + Revert to PromiseUtils methods
- PromiseUtils does not conflict with newrelics changes to Promise
- Other misc fixes
2016-07-13 19:08:24 -07:00
Ben Gotow ec9f8581f7 Merge branch 'master' of ssh://github.com/nylas/k2 2016-07-13 18:26:49 -07:00
Ben Gotow 66951b4b1a Add more logging to process claiming 2016-07-13 18:26:46 -07:00
Annie a07174cc4e fixed json parsing of message 2016-07-13 18:19:13 -07:00
Halla Moore 0706701378 Make the grayAfter time more appropriate for production, 10 mins 2016-07-13 18:00:17 -07:00
Halla Moore 49f475cdd1 Add collapsed dashboard view 2016-07-13 17:45:54 -07:00
Juan Tejada 5c1704ac8e Fix thenReturn + misc logger fixes 2016-07-13 17:41:07 -07:00
Ben Gotow 07e3f3ab19 Make dashboard boxes slightly smaller 2016-07-13 17:34:42 -07:00
Ben Gotow 2a05e69e4c Sort IDs as numbers not strings 2016-07-13 17:25:39 -07:00
Ben Gotow b43b623ca6 Expand promise utils 2016-07-13 17:22:02 -07:00
Juan b60595f0f8 Merge pull request #3 from nylas/remove-bluebird
Remove bluebird
2016-07-13 16:54:21 -07:00
Ben Gotow 35c32a3645 After authing an account, close IMAP connection 2016-07-13 16:42:13 -07:00
Juan Tejada ab9c01a249 Remove bluebird
- Implement `each` and `promisifyAll` + other bluebird fns
2016-07-13 16:35:22 -07:00
Evan Morikawa 87905d0145 Fix transaction log to ignore syncState changes 2016-07-13 16:31:34 -07:00
Halla Moore fcbaac302b Change dashboard error appearances 2016-07-13 16:31:14 -07:00
Halla Moore 971b64b4c2 Add other dashboard optimizations
Fix typo in Account's shouldComponentUpdate method
Consolidate intervals into custom window events
Manually update ElapsedTime contents
2016-07-13 16:31:14 -07:00
Ben Gotow 93942e792d Also conert imap errors in createConnectionPromise 2016-07-13 16:20:43 -07:00
Evan Morikawa 8c33c4976f Better IMAP Error handling 2016-07-13 15:57:59 -07:00
Halla Moore 0b9933b514 Re-render accounts in more scenarios and update onWebsocketConnectedFake 2016-07-13 14:53:56 -07:00
Halla Moore b03b8b537d Optimize dashboard rendering
Add version to local copy of account and only re-render entire account
if the version is different. Create an ElapsedTime component that
re-renders on its own, and update SyncGraph to re-render on its
own as well.
2016-07-13 14:34:27 -07:00
Ben Gotow a5e3ddb445 Merge branch 'master' of ssh://github.com/nylas/k2 2016-07-13 12:39:11 -07:00
Ben Gotow a11ee2987b Change proxy to honor null values, create helper for open box name 2016-07-13 12:39:07 -07:00
Evan Morikawa 3d64affc52 Delta stream adhere to old Nylas spec 2016-07-13 12:37:38 -07:00
Halla Moore f2f6dec35a Add dashboard optimizations
Make account elements absolutely positioned and opaque
Send account updates all at once, at timed intervals
2016-07-13 12:35:49 -07:00
Juan Tejada 7f72ab7f14 Add loggly logging service to test it out
- Adds env to all logs, cleans up code a bit
2016-07-13 11:58:46 -07:00
Ben Gotow ffc2593c4e Log all box attributes to help track down bug 2016-07-13 11:42:34 -07:00
Annie 6e19cd84f5 Added view query param for contact and message routes 2016-07-13 11:37:35 -07:00
Ben Gotow 7056a4b8f4 Fix bug with accounts that have uidmin=0, not 1 2016-07-13 11:30:22 -07:00
Ben Gotow ecc8bd67d3 Clean up dashboard websocket code a bit 2016-07-13 11:11:32 -07:00
Ben Gotow 8629b5a055 New function to stub dashboard view 2016-07-13 10:57:05 -07:00
Ben Gotow ea4d5d0054 Merge branch 'master' of ssh://github.com/nylas/k2 2016-07-12 18:33:33 -07:00
Annie 17f920fb90 Ordered inbox messages chronologically 2016-07-12 18:33:19 -07:00
Ben Gotow eac4f72431 Merge branch 'master' of ssh://github.com/nylas/k2 2016-07-12 18:32:00 -07:00
Ben Gotow e89975456b Fix scenario where sync worker is re-assigned the same account before fully releasing it 2016-07-12 18:31:55 -07:00
Evan Morikawa e658f066dd Change transaction schema to match current API 2016-07-12 18:31:00 -07:00
Halla Moore 1ce430cd2a Add an auto refresh option to the dashboard's syncback requests modal 2016-07-12 18:27:04 -07:00
Halla Moore 8e790a0e15 Spruce up the dashboard
Consloidate modal functionality into its own component and make
general appearance fixes, especially with the Syncback Request
Details.
2016-07-12 18:27:04 -07:00
Ben Gotow 3e8623d383 Move charset definition to single location 2016-07-12 18:03:08 -07:00
Ben Gotow a62e858389 Make charset explicit on connection and models 2016-07-12 17:41:16 -07:00
Ben Gotow efc8d8ba12 Merge branch 'master' of ssh://github.com/nylas/k2 2016-07-12 16:46:17 -07:00
Ben Gotow 562cedf971 Fix sync worker stopping forever on errors 2016-07-12 16:46:14 -07:00
Annie 83a6a8008b Add thread id to message model 2016-07-12 16:27:57 -07:00
Ben Gotow 9d7343eb91 Fix UTF7 reference - prod will not use ssh 2016-07-12 16:24:03 -07:00
Ben Gotow ae082c5b53 Fix support for Gmail accts with non-english folders 2016-07-12 16:12:04 -07:00
Ben Gotow 8b1e9564cf Fix UTF7 support — module didn’t support Node6 2016-07-12 16:11:29 -07:00
Ben Gotow 7d92438d57 Change firstSyncCompletion to string, cast to int for JSON 2016-07-12 15:23:55 -07:00
Ben Gotow dfa16fb5fc Allow firstSyncCompletion to be null 2016-07-12 15:04:12 -07:00
Ben Gotow 84d8979265 Add ability to auth gmail account via /auth 2016-07-12 13:24:48 -07:00
Halla Moore 3e6e5e95b9 Add dashboard functionality to clear sync errors 2016-07-12 12:20:12 -07:00
Ben Gotow 674da27296 Fix flipped errored / ended handlers 2016-07-12 12:15:46 -07:00
Ben Gotow b0a6ec066b Sync non-active accounts more infrequently 2016-07-12 09:53:04 -07:00
Ben Gotow ac627f1580 Remove use of Rx.toPromise(), which wasn't behaving as expected 2016-07-12 01:33:56 -07:00
Ben Gotow b44272621d Misc cleanup, put account ids on dashboard 2016-07-12 00:59:41 -07:00
Ben Gotow 4fb848e91f fix for re-authing the same account 2016-07-11 21:38:05 -07:00
Annie 87091a414a Merge branch 'master' into contacts 2016-07-11 18:30:28 -07:00
Annie c5dce43da7 Merge branch 'master' of github.com:nylas/K2 2016-07-11 18:30:19 -07:00
Annie d575e63ede replaced console logs with new logger 2016-07-11 18:30:08 -07:00
Ben Gotow 73fc371825 Make the graphs on the dashboard retina 💄 2016-07-11 18:24:18 -07:00
Juan Tejada afeb0e7b27 Create one CloudWatch stream per host
- This prevents `InvalidSequenceTokenException` when running in
production with multiple machines in an elastic beanstalk environment
- See
https://github.com/mirkokiefer/bunyan-cloudwatch/issues/1#issuecomment-193116799
2016-07-11 17:57:43 -07:00
Juan Tejada 413a77c323 Log unhandled errors in api and sync 2016-07-11 17:42:49 -07:00
Ben Gotow 74430dd80e Merge branch 'master' of ssh://github.com/nylas/k2 2016-07-11 16:56:27 -07:00
Ben Gotow 492ac21bb6 Primitive account deletion via DELETE /account 2016-07-11 16:56:18 -07:00
Annie caee5dbef0 Merge branch 'master' of github.com:nylas/K2 into contacts 2016-07-11 16:42:15 -07:00
Juan Tejada f8b8dfb87f Revert to running pm2 in no-daemon mode in dev
- Add a stream for pretty logging in dev mode
2016-07-11 16:40:48 -07:00
Annie 1fc30fa810 Merge branch 'master' of github.com:nylas/K2 2016-07-11 16:37:44 -07:00
Annie e673573fcd added folder view api route 2016-07-11 16:37:39 -07:00
Juan Tejada ae51646de6 Comment out new relic for now 2016-07-11 16:33:56 -07:00
Juan Tejada 2dc31cb576 Add number of syncing accounts to sync process manager heartbeat 2016-07-11 16:24:48 -07:00
Ben Gotow 8e0cd92bad Require a logger when instantiating a connection 2016-07-11 16:02:53 -07:00
Ben Gotow 06d31b4d49 Merge branch 'master' of ssh://github.com/nylas/k2 2016-07-11 16:01:22 -07:00
Ben Gotow 3c63268eec Return a new token for existing account instead of duplicating accounts 2016-07-11 16:01:18 -07:00
Juan Tejada 960dbdeb8f Update logger for sync process manager
- Log identity data always
2016-07-11 15:40:36 -07:00
Ben Gotow 5085730902 Merge pull request #1 from nylas/contacts
Build(contacts): built contact model, added routes and processor
2016-07-11 15:22:04 -07:00
Halla Moore 04ab0d9034 Change firstSyncCompletedAt to firstSyncCompletion, now explicitly 14 bytes. 2016-07-11 14:23:46 -07:00
Halla Moore 0860f3027c Fix two small errors 2016-07-11 14:23:46 -07:00
Evan Morikawa 1360599ffc Fix deafult test account email address 2016-07-11 14:23:35 -07:00
Juan Tejada b7301f5dc5 Fix more error handling in sync worker 2016-07-11 14:10:30 -07:00
Annie 5868fb5207 make changes requested before pull 2016-07-11 13:48:00 -07:00
Juan Tejada 6ff596b5a7 Properly log uncaight errors in sync worker 2016-07-11 13:46:50 -07:00
Halla Moore 877a6bf612 Add SyncbackRequest details to dashboard 2016-07-11 12:57:18 -07:00
Juan Tejada 1c4434c136 Re-emit error events on bunyan log streams 2016-07-11 12:12:38 -07:00
Juan Tejada 98c17c9780 Fix api logger decorator 2016-07-11 11:47:42 -07:00
Juan Tejada 600245ebcb Fix cloudwatch config 2016-07-11 11:28:53 -07:00
Ben Gotow 4ce68e3dd4 Merge branch 'master' of ssh://github.com/nylas/k2 2016-07-11 10:56:11 -07:00
Ben Gotow 93189b0f22 Try adding newrelic logging 2016-07-11 10:56:08 -07:00
Juan Tejada dce872fac8 Adds bunyan for json logging on every package!
- Bunyan logs json output, and added a stream to send our logs to
cloudwatch
- Replaces /all/ instances of console.log. Turned eslint rule back on,
so we don't use console.log ever again.
- Added npm scripts to view pretty logs
2016-07-08 17:30:24 -07:00
Annie cb20f8cecd resolved merge -- Accounts and contacts are now both added to serilaization 2016-07-08 17:09:57 -07:00
Annie 2a776e6cff Build(contacts): built contact model, added routes and processor 2016-07-08 17:06:21 -07:00
Ben Gotow 14b5bef0a7 Fix error handling on connection close 2016-07-08 16:59:00 -07:00
Ben Gotow 016bad67b9 Temporarily patch /account to not check schema 2016-07-08 16:53:01 -07:00
Ben Gotow 26ac02e0bf Merge branch 'master' of ssh://github.com/nylas/k2 2016-07-08 15:36:56 -07:00
Ben Gotow 8c122a57a3 Stop syncing in a hard loop 2016-07-08 15:36:50 -07:00
Evan Morikawa ab8f1b4fbf Silent transactions if only syncState changes 2016-07-08 18:33:37 -04:00
Ben Gotow 53a2e7e56b Add ping to dashboard, wait to get shared db 2016-07-08 14:55:12 -07:00
Ben Gotow 3e348252ab Fix issue with default values — just implement in getters 2016-07-08 14:41:53 -07:00
Ben Gotow 17df581105 Use TEXT vs STRING, specify string column lengths 2016-07-08 13:49:51 -07:00
Evan Morikawa 1ff61beec9 package json fixed 2016-07-07 16:08:19 -07:00
Evan Morikawa 0972592aa5 Add ports to pm2-dev 2016-07-07 16:05:44 -07:00
Ben Gotow 0bfa8023f2 Merge branch 'master' of ssh://github.com/nylas/k2
Conflicts:
	Dockerfile
2016-07-07 15:27:56 -07:00
Ben Gotow 63f66fb7e7 Switch to PM2 for dev + prod 2016-07-07 15:25:45 -07:00
Halla Moore a71e5c6a63 Merge branch 'master' of github.com:nylas/k2 2016-07-07 14:31:08 -07:00
Halla Moore 2db11d7dec Enhance sync stats on dashboard 2016-07-07 14:30:51 -07:00
Evan Morikawa 3820521d62 Dockerfile successfully building ping endpoint 2016-07-07 12:10:01 -07:00
Ben Gotow 822b8e54e6 Allow usage with mysql in addition to SQLite 2016-07-07 11:37:55 -07:00
Halla Moore 40ab07cfdf Add account filtering (by error status) to dashboard 2016-07-06 16:49:16 -07:00
Halla Moore 44e377eb80 Merge branch 'master' of github.com:nylas/k2 2016-07-06 15:48:47 -07:00
Halla Moore 12560ab711 Add ability to apply a sync policy to all accounts from dashboard 2016-07-06 15:48:25 -07:00
Evan Morikawa 2e4427d96e Add console to ping 2016-07-06 14:59:56 -07:00
Halla Moore 3bfc5aff60 Merge branch 'master' of github.com:nylas/k2 2016-07-05 15:45:18 -07:00
Halla Moore 9c342c0c77 Add ability to edit sync policy from dashboard 2016-07-05 15:41:56 -07:00
Evan Morikawa e2e827297c Add authless /ping endpoint that returns "pong" 2016-07-05 14:09:44 -07:00
Juan Tejada 8b1f012a3c Fix error serialization
- Remove cumbersome NylasError
- Add helper to serialize error when saving to account
2016-07-01 15:49:47 -07:00
Ben Gotow a43b3fb015 Merge branch 'master' of ssh://github.com/nylas/k2 2016-07-01 15:41:29 -07:00
Ben Gotow 8453985b1f Change worker removal so it waits for sync to complete 2016-07-01 15:41:22 -07:00
Jackie Luo 81145eae32 Change error styling 2016-07-01 13:24:08 -07:00
Jackie Luo 0af1a43794 Add first sync completion time 2016-07-01 13:15:55 -07:00
Ben Gotow 3ccb7f164b Fix closing connection twice 2016-07-01 11:36:14 -07:00
Evan Morikawa fd0c4d734c Fix delta sync to properly includes sub models 2016-07-01 11:27:20 -07:00
Juan Tejada 05091a4447 Update thrown errors to use serializable NylasError 2016-07-01 10:24:39 -07:00
Juan Tejada 80f9ff38e3 Remove dead code 2016-07-01 10:19:25 -07:00
Jackie Luo a99ffbce3c Add favicon :snow_capped_mountain: 2016-06-30 17:31:52 -07:00
Jackie Luo 27eba6dfaa Add sync times and update styles 2016-06-30 17:24:25 -07:00
Halla Moore 84ce3bdeb3 Merge branch 'master' of github.com:nylas/k2 2016-06-30 17:11:05 -07:00
Halla Moore c5157b3553 Fixed 'in' filter for threads endpoint 2016-06-30 17:10:48 -07:00
Jackie Luo ddf73b6b02 Keep track of sync completion timestamps 2016-06-30 17:04:13 -07:00
Halla Moore ce61326f7c Make query keys not camel case 2016-06-30 16:23:55 -07:00
Halla Moore 7221ae3bb9 Added File filtering 2016-06-30 16:19:57 -07:00
Halla Moore f94acfcb9b Added filename query to threads endpoint 2016-06-30 16:09:02 -07:00
Halla Moore d68151a684 Merge branch 'master' of github.com:nylas/k2 2016-06-30 15:49:03 -07:00
Halla Moore aec946f7de Added 'in' query to messages endpoint 2016-06-30 15:23:34 -07:00
Halla Moore 6225f09018 Added some filter queries for Messages 2016-06-30 14:22:23 -07:00
Ben Gotow 04d482650c Fix processor running out of file descriptors due to re-creating redis connections 2016-06-30 13:28:41 -07:00
Ben Gotow 65a6ea4546 Redis takes seconds, not milliseconds 2016-06-30 13:28:26 -07:00
Ben Gotow 3c2b8bcb15 Fix account creation redis publish, rename to make more clear 2016-06-30 13:25:13 -07:00
Ben Gotow ef5c4a29fe Fix redis keys, dashboard app, show account active state on dashboard 2016-06-30 12:33:10 -07:00
Ben Gotow f9952f9fa7 Fix 500 error when account token does not resolve to account 2016-06-30 12:33:10 -07:00
Halla Moore d0666540b9 Added syncback tasks for folders 2016-06-30 11:54:12 -07:00
Ben Gotow 4d4a4cec32 Fix backwards logic preventing thread creation! 2016-06-30 11:04:51 -07:00
Ben Gotow a1419a65a5 Update folderId => folderImapUID, rename messageI to uid 2016-06-30 09:33:04 -07:00
Ben Gotow b033b94091 Break Category into Folder, Label, populate Gmail lables for messages 2016-06-30 09:29:21 -07:00
Ben Gotow 5a6daf9556 Stop sqlite from waiting 1sec to retry table locks 2016-06-30 00:19:57 -07:00
Jackie Luo b3b5a5106c Add endpoint for file downloads 2016-06-29 19:14:04 -07:00
Halla Moore fd7570f6c8 Add various syncback tasks for messages 2016-06-29 18:52:58 -07:00
Halla Moore 80d80eb306 Added StarThread and UnstarThread imap tasks 2016-06-29 17:36:34 -07:00
Halla Moore 2a77196fd9 Merge branch 'master' of github.com:nylas/k2 2016-06-29 17:23:27 -07:00
Halla Moore ef11508b38 Added MarkThreadAsUnread task 2016-06-29 17:23:18 -07:00
Evan Morikawa 4d7f728a75 categoryUID -> categoryImapUID and messageId -> messageHeaderId 2016-06-29 17:10:34 -07:00
Halla Moore d3fd671ff6 Update MarkThreadAsRead task 2016-06-29 17:01:30 -07:00
Evan Morikawa 6cb67e417c Fix to use Imap BOX and simplify move helper 2016-06-29 16:25:51 -07:00
Halla Moore c7fa9a782f Merge branch 'master' of github.com:nylas/k2 2016-06-29 16:12:44 -07:00
Halla Moore 825ce2eba3 Use categoryUID instead of categoryId, change default value to match node-imap 2016-06-29 16:12:29 -07:00
Ben Gotow b00b1e6d21 Add replyTo to message model 2016-06-29 16:10:45 -07:00
Halla Moore da27959009 Changed some variables so that first letter is lowercase 2016-06-29 15:07:29 -07:00
Evan Morikawa fc3796ff66 Fix transaction case issue 2016-06-29 14:58:38 -07:00
Evan Morikawa 5a56c9a4e4 AccountId -> accountId 2016-06-29 14:43:20 -07:00
Evan Morikawa 9ba3ac1bfd Merge branch 'syncback' 2016-06-29 14:25:52 -07:00
Evan Morikawa 905d797fd2 Remove comments 2016-06-29 14:25:42 -07:00
Evan Morikawa 124f0a9579 Add sigterm 2016-06-29 14:19:04 -07:00
Halla Moore a45306729f Merge branch 'syncback' of github.com:nylas/k2 into syncback 2016-06-29 14:01:01 -07:00
Halla Moore bf39b51e08 Correct some function names/params 2016-06-29 14:00:47 -07:00
Evan Morikawa 6a6e1f4f60 Remove loggin in api 2016-06-29 12:29:21 -07:00
Halla Moore 2721617665 Use CategoryId instead of messageId 2016-06-29 12:28:22 -07:00
Evan Morikawa 0e80bce433 readonly false 2016-06-29 12:26:45 -07:00
Evan Morikawa 3753d9743a Fix return 2016-06-29 12:25:38 -07:00
Evan Morikawa d26824771d Clean up loggin 2016-06-29 12:08:31 -07:00
Halla Moore bdfee404e5 Add move imap wrapper, make sure wrapper methods are called 2016-06-29 12:07:28 -07:00
Evan Morikawa 7cf59c3c11 Fix retrun value in MoveToFolderIMAP task 2016-06-29 12:04:46 -07:00
Ben Gotow a25c399652 Downcase remaining model names 2016-06-29 12:04:22 -07:00
Ben Gotow 53d6c6284e Support for /threads?view=count/expanded, thread & message JSON includes folders 2016-06-29 12:02:31 -07:00
Evan Morikawa 941180c1df Syncback WIP 2016-06-29 11:44:30 -07:00
Ben Gotow 9ff7d3aea5 Add folders and labels to /threads response, version numbers to all models 2016-06-29 11:22:38 -07:00
Ben Gotow 6ecacdd591 Add account_id to all responses, downcase model ref columns 2016-06-29 10:36:35 -07:00
Evan Morikawa ab19133b20 Add SyncbackTask super class 2016-06-29 10:13:56 -07:00
Evan Morikawa cf87325c5d Fix syncback request object 2016-06-29 10:13:56 -07:00
Halla Moore 8a53dca755 Merge branch 'master' of github.com:nylas/k2 2016-06-29 10:10:49 -07:00
Evan Morikawa ba2d865a5d Cleanup syncback request 2016-06-28 19:07:49 -07:00
Evan Morikawa 11a3a8f58e Cleanup syncback task 2016-06-28 19:02:24 -07:00
Ben Gotow c7422ffaea Fix bug where always closing connection after sync 2016-06-28 18:43:53 -07:00
Ben Gotow 0189e3e77d Break Gmail mailboxes into folders and labels 2016-06-28 18:31:40 -07:00
Evan Morikawa 7180ebbb70 PUT route works on threads to create SyncbackRequests 2016-06-28 18:17:11 -07:00
Ben Gotow ad484e8ae1 Add object key to all JSON responses 2016-06-28 18:14:54 -07:00
Evan Morikawa 306086091d syncbackMessageActions refactor 2016-06-28 18:13:49 -07:00
Halla Moore f5af9c0cb5 Added a syncback task to mark a thread as read, untested 2016-06-28 18:13:49 -07:00
Ben Gotow 222c68a598 Deprecate thread.cleanedSubject, since the only subject is the clean one 2016-06-28 18:11:55 -07:00
Ben Gotow 1d1186cb34 Add more attributes to /threads, move processor to it's own process 2016-06-28 18:10:52 -07:00
Evan Morikawa cea7783a5f syncbackMessageActions refactor 2016-06-28 17:12:45 -07:00
Halla Moore b867bcb31e Merge branch 'master' of github.com:nylas/k2 2016-06-28 15:56:35 -07:00
Evan Morikawa 2d90c5bb14 Fixes to sync worker 2016-06-28 15:44:38 -07:00
Ben Gotow ca0120a824 Allow sync after errors with env var 2016-06-28 15:37:22 -07:00
Evan Morikawa 14cffcf8a5 Change to notify / observe for syncback requests 2016-06-28 15:35:59 -07:00
Ben Gotow a10543c1c8 Chunk sync of large mailboxes, keep track of synced UID range, not just uidnext 2016-06-28 15:30:56 -07:00
Halla Moore 0f64b6e58e Add category filtering to threads api endpoint 2016-06-28 15:01:41 -07:00
Evan Morikawa 0f4ed7f4a1 Fix package json 2016-06-28 14:09:56 -07:00
Ben Gotow 8108a875ee Allow trailing slashes on API endpoints 2016-06-28 13:57:07 -07:00
Jackie Luo eaf19cc522 Add files endpoint for metadata 2016-06-28 13:55:00 -07:00
Jackie Luo a00f86660c Create file objects from MIME parts 2016-06-28 11:32:18 -07:00
Juan Tejada c5d753a434 Add /very/ basic initial error status to dashboard
- TODO: add option to solve the error
2016-06-27 23:59:22 -07:00
Ben Gotow f68948c23f Fix population of db fields in processor 2016-06-27 16:38:40 -07:00
Ben Gotow 91887a6e11 Speed up sync by fetching preferred body block only 2016-06-27 16:11:36 -07:00
Juan Tejada ed749e0f51 Add sync worker error handling
- Handles sync errors in a single place. For now, if error is not a
socket error, will treat as a permanent error, save the error to the
account object, and prevent any other syncing until the error is cleared
from the account object
- Adds a NylasError class that can be extended and serialized. Adds it
to global namespace on all packages and replaces all uses of regular
Error
2016-06-27 16:03:38 -07:00
Jackie Luo cf421cbb2d Check In-Reply-To instead of References 2016-06-27 14:58:09 -07:00
Jackie Luo 179f24449b Refactor code and add test for threading 2016-06-27 14:52:05 -07:00
Halla Moore 5077b3f027 Add subject query to threads route 2016-06-27 13:45:11 -07:00
Halla Moore 2e56d3ced4 Add timestamp queries to threads route 2016-06-27 12:30:28 -07:00
Ben Gotow 76d873c2b2 Reintroduce concept of provider, start work on Gmail 2016-06-27 10:43:53 -07:00
Halla Moore ab4c8cf32c Add id query to threads route 2016-06-27 10:35:34 -07:00
Juan Tejada 1fe7fdf4b1 More sync error handling WIP 2016-06-27 10:27:38 -07:00
Halla Moore 621f8b5c2b Add starred query to threads route 2016-06-27 10:15:05 -07:00
Juan Tejada 63b929e59b Fix missing promise based error handling in sync-worker 2016-06-26 09:52:03 -07:00
Juan Tejada dd350a5081 Update IMAPConnection api + error handling fixes + misc
- `IMAPConnection::openBox` now returns a Promise that resolves to an
IMAPBox, and IMAPBox contains all of the `fetch` operations. This makes
the dependency between fetch operations and the currently open mailbox
explicit rather than implicit and by forcing the operations to be called on
a box instance and hopefully prevent errors. It will also throw an error
if the constraint is no longer satisfied.

- `fetch` operations now return an observable stream of messages (or Promise for single value),
while preserving the same logic of the original implementation. You can use `.toPromise()` on
the observable to get a Promise that resolves when the observable stream has
completely drained.

- Fixes error handling in a few places and renames some variables
2016-06-26 01:57:33 -07:00
Juan Tejada 63f48ae817 Adds hapi-boom for easy error responses 2016-06-26 01:44:39 -07:00
Juan Tejada 1336dea0d4 Fix auth response + log errors 2016-06-25 22:19:05 -07:00
Juan Tejada caaef8d5b5 Add /messages/<id> enpoint + support for raw message/rfc822
- When message/rfc822 is requested, fetch ray message from IMAP
connection
2016-06-25 11:25:34 -07:00
Ben Gotow 69e87cbf49 Gmail auth at http://localhost:5100/auth/gmail 2016-06-24 16:46:41 -07:00
Halla Moore bc5a4ecf3c Add unread query to threads route 2016-06-24 16:14:04 -07:00
Halla Moore 18ad15937f Change uppercase instance of Joi to lowercase 2016-06-24 14:07:10 -07:00
Juan Tejada 8f945888e4 Add missing test fixtures and fix path for reading them 2016-06-24 10:39:30 -07:00
Juan Tejada ee2dc6c3f6 Expect true to be true 2016-06-24 10:36:57 -07:00
Juan Tejada 0ac3c8c313 Add jasmine for message-processor 2016-06-24 10:35:34 -07:00
Ben Gotow b67a3ae3e4 Launch dashboard when in dev mode, publish change on acct creation 2016-06-23 18:17:04 -07:00
Ben Gotow f678045c4f sync db <=> redis with sequelize hooks 2016-06-23 16:28:51 -07:00
Ben Gotow eac019f536 Rather than changing policies, just set expiring redis key to track activity 2016-06-23 16:28:48 -07:00
Ben Gotow 09bb7874f8 Dashboard with a sweet background. Also realtime assignment / policy view. 2016-06-23 15:52:53 -07:00
Evan Morikawa 3f5cac4342 Adding in syncback message actions 2016-06-23 16:47:07 -06:00
Jackie Luo b6f57f3ce8 Add threading algorithm 2016-06-23 15:44:03 -07:00
Jackie Luo f9fe836899 Fix syntax error 2016-06-23 15:21:54 -07:00
Jackie Luo 5cc4841ac6 Add check for Gmail thread ID 2016-06-23 15:19:20 -07:00
Evan Morikawa 6ad9cdd322 Fixing broken processors 2016-06-23 14:15:30 -06:00
Evan Morikawa 8160acc81e Add imap dependency to package.json 2016-06-23 13:18:33 -06:00
Evan Morikawa 1460a0ae9f Rename Refresh to Sync 2016-06-23 13:16:15 -06:00
Ben Gotow 8e692982bb Remove concept of self-limiting workers, will use cloudwatch metrics collection to scale fleet instead of queue length 2016-06-23 12:02:57 -07:00
Ben Gotow f7c647f7ba Return syncs to unclaimed queue after CLAIM_DURATION, just because it's healthy 2016-06-23 11:45:33 -07:00
Ben Gotow c2e9093b42 Escalate sync policy based on number of stream connections 2016-06-23 11:45:33 -07:00
Jackie Luo ae54192ed6 Update threading and fix typo 2016-06-23 10:35:47 -07:00
Juan Tejada a917022505 Update order of threading processor 2016-06-23 10:26:41 -07:00
Ben Gotow ad1683c9a5 Fix reference to __base 2016-06-23 10:11:07 -07:00
Ben Gotow 12d9db8dd9 Redis coordination of sync processes / assignment 2016-06-23 00:49:26 -07:00
Ben Gotow 2e9bfa68b5 Refactor DeltaStreamQueue (connection per subscription) 2016-06-23 00:49:26 -07:00
Jackie Luo cb95574378 Fix associations 2016-06-22 17:34:29 -07:00
Jackie Luo e64c2ae4c0 Add basic threading 2016-06-22 17:34:29 -07:00
Ben Gotow f5f435236f /auth + remove hardcoded stub in favor of curl request 2016-06-22 17:19:48 -07:00
Evan Morikawa 06393dd07c Move categories & messages to new monorepo structure 2016-06-22 14:44:09 -07:00
Ben Gotow 95fbb64d17 Add /messages, /folders, /account 2016-06-22 14:42:08 -07:00
Evan Morikawa 18f2925b43 Convert to monorepo 2016-06-22 14:41:32 -07:00