diff --git a/analytics/package.json b/analytics/package.json index d6814eaf6b..6fb1fd070b 100644 --- a/analytics/package.json +++ b/analytics/package.json @@ -6,17 +6,19 @@ }, "dependencies": { "amplitude": "^3.5.0", - "aws-sdk": "^2.373.0", + "aws-sdk": "^2.383.0", "bull": "3.3.10", "datadog-metrics": "^0.8.1", - "debug": "^4.1.0", + "debug": "^4.1.1", "faker": "^4.1.0", "ioredis": "3.2.2", "lodash.intersection": "^4.4.0", "node-env-file": "^0.1.8", "now-env": "^3.1.0", + "performance-now": "^2.1.0", "raven": "^2.6.4", "redis-tag-cache": "^1.2.1", + "rethinkdb-inspector": "^0.3.3", "rethinkdbdash": "^2.3.31", "rethinkhaberdashery": "^2.3.32", "sanitize-filename": "^1.6.1", diff --git a/analytics/yarn.lock b/analytics/yarn.lock index 725cd66909..34fb0b0281 100644 --- a/analytics/yarn.lock +++ b/analytics/yarn.lock @@ -14,10 +14,10 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= -aws-sdk@^2.373.0: - version "2.373.0" - resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.373.0.tgz#fcc5606634b3b11d80810ad252d1b52b3733d780" - integrity sha512-NZYXwXGtFt9jxaKXc+PJsLPnpbD03t0MAZRxh93g36kbFMuRXtY8CDqHYNQ0ZcrgQpXbCQiz1fxT5/wu5Cu70g== +aws-sdk@^2.383.0: + version "2.383.0" + resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.383.0.tgz#86045c0a4a4898dca84a4877cbe765b7dc0f8bba" + integrity sha512-PN+s+NTABtBloS46c7C2dvoEzrdY2NZ5nsfljL3xDX2rvjJEQxdchS2jcCpyc5ZNudFwta66wY4EGBZqf4Attw== dependencies: buffer "4.9.1" events "1.1.1" @@ -150,10 +150,10 @@ debug@^3.1.0: dependencies: ms "^2.1.1" -debug@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.0.tgz#373687bffa678b38b1cd91f861b63850035ddc87" - integrity sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg== +debug@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== dependencies: ms "^2.1.1" @@ -485,6 +485,11 @@ object-keys@^1.0.12: resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2" integrity sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag== +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= + process-nextick-args@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" @@ -568,6 +573,11 @@ redis-tag-cache@^1.2.1: dependencies: ioredis "^4.0.0" +rethinkdb-inspector@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/rethinkdb-inspector/-/rethinkdb-inspector-0.3.3.tgz#f0d88c66d17e0234b5518ca51cd8c272cb787003" + integrity sha512-1R0S5maattWOptfkHsU5ulXnt6FIKqjgyEdd8WgW9QbYMiHaXNqkHTAsmtXXSAf0j5iFH3F2qq/7eg4xwb8Euw== + rethinkdbdash@^2.3.31: version "2.3.31" resolved "https://registry.yarnpkg.com/rethinkdbdash/-/rethinkdbdash-2.3.31.tgz#fe2f73d1fa6e6f5d96d8e881292013cf6dca914d" diff --git a/api/package.json b/api/package.json index 1b080d33f4..32d90563cf 100644 --- a/api/package.json +++ b/api/package.json @@ -27,7 +27,7 @@ "datadog-metrics": "^0.8.1", "dataloader": "^1.4.0", "debounce": "^1.2.0", - "debug": "^4.1.0", + "debug": "^4.1.1", "decode-uri-component": "^0.2.0", "draft-js": "^0.10.5", "draft-js-code-editor-plugin": "0.2.1", @@ -98,13 +98,13 @@ "react-helmet": "5.x", "react-infinite-scroller-with-scroll-element": "^1.0.4", "react-loadable": "5.2.2", - "react-modal": "^3.7.1", + "react-modal": "^3.8.1", "react-redux": "^5.1.1", "react-remarkable": "^1.1.1", "react-router": "^4.0.0-beta.7", "react-router-dom": "^4.0.0-beta.7", "react-textarea-autosize": "^4.0.5", - "react-transition-group": "^2.5.0", + "react-transition-group": "^2.5.2", "react-trend": "^1.2.4", "recompose": "^0.23.1", "redis-tag-cache": "^1.2.1", @@ -116,7 +116,7 @@ "rethinkdb-migrate": "^1.4.0", "rethinkhaberdashery": "^2.3.32", "sanitize-filename": "^1.6.1", - "serialize-javascript": "^1.5.0", + "serialize-javascript": "^1.6.1", "session-rethinkdb": "^2.0.0", "slate": "^0.44.9", "slate-markdown": "0.1.0", diff --git a/api/routes/auth/google.js b/api/routes/auth/google.js index 5b98dfdfd3..4289281490 100644 --- a/api/routes/auth/google.js +++ b/api/routes/auth/google.js @@ -4,10 +4,7 @@ import { createSigninRoutes } from './create-signin-routes'; const googleAuthRouter = Router(); const { main, callbacks } = createSigninRoutes('google', { - scope: [ - 'https://www.googleapis.com/auth/plus.login', - 'https://www.googleapis.com/auth/plus.profile.emails.read', - ], + scope: 'profile email', }); googleAuthRouter.get('/', main); diff --git a/api/yarn.lock b/api/yarn.lock index 7cd54e8a61..1042f0c517 100644 --- a/api/yarn.lock +++ b/api/yarn.lock @@ -3172,6 +3172,13 @@ debug@^4.1.0: dependencies: ms "^2.1.1" +debug@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== + dependencies: + ms "^2.1.1" + debuglog@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" @@ -7746,10 +7753,10 @@ react-loadable@5.2.2: resolved "https://registry.yarnpkg.com/react-loadable/-/react-loadable-5.2.2.tgz#1a5ad75841cacb64be12b18a86ac0bc55ccb4dc7" integrity sha1-GlrXWEHKy2S+ErGKhqwLxVzLTcc= -react-modal@^3.7.1: - version "3.7.1" - resolved "https://registry.yarnpkg.com/react-modal/-/react-modal-3.7.1.tgz#342ed170133d0557e6c3e6fc40195bc45c8f09c3" - integrity sha512-eSgotXkqOCXi0b27AwLCoJ8yqLepKnbZdMp/zfUmZPnMNoe39pDT0mbAPq9rp+TToqM5GUTv8C36Cuja+ThbhA== +react-modal@^3.8.1: + version "3.8.1" + resolved "https://registry.yarnpkg.com/react-modal/-/react-modal-3.8.1.tgz#7300f94a6f92a2e17994de0be6ccb61734464c9e" + integrity sha512-aLKeZM9pgXpIKVwopRHMuvqKWiBajkqisDA8UzocdCF6S4fyKVfLWmZR5G1Q0ODBxxxxf2XIwiCP8G/11GJAuw== dependencies: exenv "^1.2.0" prop-types "^15.5.10" @@ -7816,10 +7823,10 @@ react-textarea-autosize@^4.0.5: dependencies: prop-types "^15.5.8" -react-transition-group@^2.5.0: - version "2.5.1" - resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-2.5.1.tgz#67fbd8d30ebb1c57a149d554dbb82eabefa61f0d" - integrity sha512-8x/CxUL9SjYFmUdzsBPTgtKeCxt7QArjNSte0wwiLtF/Ix/o1nWNJooNy5o9XbHIKS31pz7J5VF2l41TwlvbHQ== +react-transition-group@^2.5.2: + version "2.5.2" + resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-2.5.2.tgz#9457166a9ba6ce697a3e1b076b3c049b9fb2c408" + integrity sha512-vwHP++S+f6KL7rg8V1mfs62+MBKtbMeZDR8KiNmD7v98Gs3UPGsDZDahPJH2PVprFW5YHJfh6cbNim3zPndaSQ== dependencies: dom-helpers "^3.3.1" loose-envify "^1.4.0" @@ -8427,11 +8434,16 @@ send@0.16.2: range-parser "~1.2.0" statuses "~1.4.0" -serialize-javascript@^1.4.0, serialize-javascript@^1.5.0: +serialize-javascript@^1.4.0: version "1.5.0" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.5.0.tgz#1aa336162c88a890ddad5384baebc93a655161fe" integrity sha512-Ga8c8NjAAp46Br4+0oZ2WxJCwIzwP60Gq1YPgU+39PiTVxyed/iKE/zyZI6+UlVYH5Q4PaQdHhcegIFPZTUfoQ== +serialize-javascript@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.6.1.tgz#4d1f697ec49429a847ca6f442a2a755126c4d879" + integrity sha512-A5MOagrPFga4YaKQSWHryl7AXvbQkEqpw4NNYMTNYUNV51bA8ABHgYFpqKx+YFFrw59xMV1qGH1R4AgoNIVgCw== + serve-static@1.13.2: version "1.13.2" resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.13.2.tgz#095e8472fd5b46237db50ce486a43f4b86c6cec1" diff --git a/athena/package.json b/athena/package.json index 82275ecef1..a19681aac8 100644 --- a/athena/package.json +++ b/athena/package.json @@ -5,12 +5,12 @@ "start": "NODE_ENV=production node main.js" }, "dependencies": { - "aws-sdk": "^2.373.0", + "aws-sdk": "^2.383.0", "axios": "^0.16.2", "bull": "3.3.10", "cryptr": "^3.0.0", "datadog-metrics": "^0.8.1", - "debug": "^4.1.0", + "debug": "^4.1.1", "decode-uri-component": "^0.2.0", "draft-js": "^0.10.5", "emoji-regex": "^6.5.1", @@ -21,8 +21,10 @@ "lodash.intersection": "^4.4.0", "node-env-file": "^0.1.8", "now-env": "^3.1.0", + "performance-now": "^2.1.0", "raven": "^2.6.4", "redis-tag-cache": "^1.2.1", + "rethinkdb-inspector": "^0.3.3", "rethinkdbdash": "^2.3.31", "rethinkhaberdashery": "^2.3.32", "sanitize-filename": "^1.6.1", diff --git a/athena/yarn.lock b/athena/yarn.lock index 62f56f0b03..9b63351e50 100644 --- a/athena/yarn.lock +++ b/athena/yarn.lock @@ -23,10 +23,10 @@ asn1.js@^5.0.0: inherits "^2.0.1" minimalistic-assert "^1.0.0" -aws-sdk@^2.373.0: - version "2.373.0" - resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.373.0.tgz#fcc5606634b3b11d80810ad252d1b52b3733d780" - integrity sha512-NZYXwXGtFt9jxaKXc+PJsLPnpbD03t0MAZRxh93g36kbFMuRXtY8CDqHYNQ0ZcrgQpXbCQiz1fxT5/wu5Cu70g== +aws-sdk@^2.383.0: + version "2.383.0" + resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.383.0.tgz#86045c0a4a4898dca84a4877cbe765b7dc0f8bba" + integrity sha512-PN+s+NTABtBloS46c7C2dvoEzrdY2NZ5nsfljL3xDX2rvjJEQxdchS2jcCpyc5ZNudFwta66wY4EGBZqf4Attw== dependencies: buffer "4.9.1" events "1.1.1" @@ -175,10 +175,10 @@ debug@^3.1.0: dependencies: ms "^2.1.1" -debug@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.0.tgz#373687bffa678b38b1cd91f861b63850035ddc87" - integrity sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg== +debug@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== dependencies: ms "^2.1.1" @@ -640,6 +640,11 @@ object-keys@^1.0.12: resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2" integrity sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag== +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= + promise@^7.1.1: version "7.3.1" resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" @@ -707,6 +712,11 @@ redis-tag-cache@^1.2.1: dependencies: ioredis "^4.0.0" +rethinkdb-inspector@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/rethinkdb-inspector/-/rethinkdb-inspector-0.3.3.tgz#f0d88c66d17e0234b5518ca51cd8c272cb787003" + integrity sha512-1R0S5maattWOptfkHsU5ulXnt6FIKqjgyEdd8WgW9QbYMiHaXNqkHTAsmtXXSAf0j5iFH3F2qq/7eg4xwb8Euw== + rethinkdbdash@^2.3.31: version "2.3.31" resolved "https://registry.yarnpkg.com/rethinkdbdash/-/rethinkdbdash-2.3.31.tgz#fe2f73d1fa6e6f5d96d8e881292013cf6dca914d" diff --git a/chronos/package.json b/chronos/package.json index 75d3a529b5..14a7f58d9f 100644 --- a/chronos/package.json +++ b/chronos/package.json @@ -3,10 +3,10 @@ "start": "NODE_ENV=production node main.js" }, "dependencies": { - "aws-sdk": "^2.373.0", + "aws-sdk": "^2.383.0", "bull": "^3.5.2", "datadog-metrics": "^0.8.1", - "debug": "^4.1.0", + "debug": "^4.1.1", "decode-uri-component": "^0.2.0", "draft-js": "^0.10.5", "faker": "^4.1.0", @@ -15,8 +15,10 @@ "lodash": "^4.17.11", "lodash.intersection": "^4.4.0", "now-env": "^3.1.0", + "performance-now": "^2.1.0", "raven": "^2.6.4", "redis-tag-cache": "^1.2.1", + "rethinkdb-inspector": "^0.3.3", "rethinkdbdash": "^2.3.31", "rethinkhaberdashery": "^2.3.32", "sanitize-filename": "^1.6.1", diff --git a/chronos/queues/constants.js b/chronos/queues/constants.js index 9703183d0c..6e7f66249d 100644 --- a/chronos/queues/constants.js +++ b/chronos/queues/constants.js @@ -8,6 +8,7 @@ export const COMMUNITY_UPSELL_THRESHOLD = 5; // the end weekly digest will have threads sorted by the weight of (TOTAL * WEIGHT) + (NEW * WEIGHT) export const TOTAL_MESSAGE_COUNT_WEIGHT = 0.1; export const NEW_MESSAGE_COUNT_WEIGHT = 1.5; +export const WATERCOOLER_WEIGHT_REDUCTION = 0.5; /* Example weighting: diff --git a/chronos/queues/digests/getReputationString.js b/chronos/queues/digests/getReputationString.js index 452b54117a..3321a52ef3 100644 --- a/chronos/queues/digests/getReputationString.js +++ b/chronos/queues/digests/getReputationString.js @@ -19,10 +19,10 @@ export const getReputationString = ({ const during = timeframe === 'weekly' ? 'last week' : 'yesterday'; let reputationString; - if (!hasGainedReputation) { - reputationString = `You were a little quiet ${during} and haven't gained any reputation – join some of the conversations below, your communities would love to hear from you.`; - } else { + if (hasGainedReputation) { reputationString = `You gained ${reputationGained} reputation ${during}.`; + } else { + reputationString = `You didn’t gain any reputation ${during}.`; } if (isFirstReputation) { diff --git a/chronos/queues/digests/processThreads.js b/chronos/queues/digests/processThreads.js index 52497bc1d3..250dc760e9 100644 --- a/chronos/queues/digests/processThreads.js +++ b/chronos/queues/digests/processThreads.js @@ -3,6 +3,7 @@ import { getTotalMessageCount, getNewMessageCount } from '../../models/message'; import { NEW_MESSAGE_COUNT_WEIGHT, TOTAL_MESSAGE_COUNT_WEIGHT, + WATERCOOLER_WEIGHT_REDUCTION, } from '../constants'; import { getCommunitiesById } from 'shared/db/queries/community'; import { getChannelsById } from 'shared/db/queries/channel'; @@ -108,10 +109,19 @@ export const attachScoreToThreads = async ( ): Promise> => { const promises = threads .map(thread => { - const score = + let score = thread.newMessageCount * NEW_MESSAGE_COUNT_WEIGHT + thread.totalMessageCount * TOTAL_MESSAGE_COUNT_WEIGHT; + // watercooler threads tend to have more messages than the average thread + // often in the hundreds. So even with a small weight placed on total + // message count, watercoolers are often outranking new threads. + // to solve for this, we reduce the overall score of watercooler threads + // by a constant percentage to give higher priority to new conversations. + if (thread.watercooler) { + score = score * WATERCOOLER_WEIGHT_REDUCTION; + } + return { ...thread, score, diff --git a/chronos/queues/digests/test/__snapshots__/reputation-string.test.js.snap b/chronos/queues/digests/test/__snapshots__/reputation-string.test.js.snap index dd4a8f8e5a..26e45c5f6f 100644 --- a/chronos/queues/digests/test/__snapshots__/reputation-string.test.js.snap +++ b/chronos/queues/digests/test/__snapshots__/reputation-string.test.js.snap @@ -1,13 +1,13 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`existing users should handle no reputation gain 1`] = `"You were a little quiet last week and haven't gained any reputation – join some of the conversations below, your communities would love to hear from you. You have a total of 10 reputation across all of your communities."`; +exports[`existing users should handle no reputation gain 1`] = `"You didn’t gain any reputation last week. You have a total of 10 reputation across all of your communities."`; exports[`existing users should handle reputation gain 1`] = `"You gained 10 reputation last week. You have a total of 20 reputation across all of your communities - well done!"`; -exports[`first-time users should be told when they haven't gained any reputation 1`] = `"You were a little quiet last week and haven't gained any reputation – join some of the conversations below, your communities would love to hear from you. Reputation is an indicator of how active and constructive you are across all your communities. The more great conversations you start or join, the more reputation you will have."`; +exports[`first-time users should be told when they haven't gained any reputation 1`] = `"You didn’t gain any reputation last week. Reputation is an indicator of how active and constructive you are across all your communities. The more great conversations you start or join, the more reputation you will have."`; exports[`first-time users should get an explanation what reputation is 1`] = `"You gained 10 reputation last week. Reputation is an indicator of how active and constructive you are across all your communities. The more great conversations you start or join, the more reputation you will have."`; exports[`should handle a daily timeframe 1`] = `"You gained 10 reputation yesterday. You have a total of 20 reputation across all of your communities - well done!"`; -exports[`should handle a daily timeframe 2`] = `"You were a little quiet yesterday and haven't gained any reputation – join some of the conversations below, your communities would love to hear from you. Reputation is an indicator of how active and constructive you are across all your communities. The more great conversations you start or join, the more reputation you will have."`; +exports[`should handle a daily timeframe 2`] = `"You didn’t gain any reputation yesterday. Reputation is an indicator of how active and constructive you are across all your communities. The more great conversations you start or join, the more reputation you will have."`; diff --git a/chronos/yarn.lock b/chronos/yarn.lock index 9e481d7c6d..67cb03b0ab 100644 --- a/chronos/yarn.lock +++ b/chronos/yarn.lock @@ -7,10 +7,10 @@ asap@~2.0.3: resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY= -aws-sdk@^2.373.0: - version "2.376.0" - resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.376.0.tgz#21baebe889a46b6ed2e5cc87b490bed3c5ca9184" - integrity sha512-7/xsLzgF0GJIFTy2qPmn+dFLQoBpWponm+FS9aHUmjI0UMiTieBJzHUSZ8BHIY/4JukBLc3B5hL5evW+NS4pzw== +aws-sdk@^2.383.0: + version "2.383.0" + resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.383.0.tgz#86045c0a4a4898dca84a4877cbe765b7dc0f8bba" + integrity sha512-PN+s+NTABtBloS46c7C2dvoEzrdY2NZ5nsfljL3xDX2rvjJEQxdchS2jcCpyc5ZNudFwta66wY4EGBZqf4Attw== dependencies: buffer "4.9.1" events "1.1.1" @@ -136,10 +136,10 @@ debug@^3.1.0: dependencies: ms "^2.1.1" -debug@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.0.tgz#373687bffa678b38b1cd91f861b63850035ddc87" - integrity sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg== +debug@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== dependencies: ms "^2.1.1" @@ -523,6 +523,11 @@ object-keys@^1.0.12: resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2" integrity sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag== +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= + promise@^7.1.1: version "7.3.1" resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" @@ -590,6 +595,11 @@ redis-tag-cache@^1.2.1: dependencies: ioredis "^4.0.0" +rethinkdb-inspector@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/rethinkdb-inspector/-/rethinkdb-inspector-0.3.3.tgz#f0d88c66d17e0234b5518ca51cd8c272cb787003" + integrity sha512-1R0S5maattWOptfkHsU5ulXnt6FIKqjgyEdd8WgW9QbYMiHaXNqkHTAsmtXXSAf0j5iFH3F2qq/7eg4xwb8Euw== + rethinkdbdash@^2.3.31: version "2.3.31" resolved "https://registry.yarnpkg.com/rethinkdbdash/-/rethinkdbdash-2.3.31.tgz#fe2f73d1fa6e6f5d96d8e881292013cf6dca914d" diff --git a/cypress/integration/thread/chat_input_spec.js b/cypress/integration/thread/chat_input_spec.js index 3ca44d7cd1..0fd0ece03d 100644 --- a/cypress/integration/thread/chat_input_spec.js +++ b/cypress/integration/thread/chat_input_spec.js @@ -31,17 +31,14 @@ describe('chat input', () => { it('should render', () => { cy.get('[data-cy="thread-view"]').should('be.visible'); - cy.get('[data-cy="chat-input-send-button"]').should('be.visible'); + cy.get('[data-cy="chat-input-send-button"]').should('not.be.visible'); cy.get('[data-cy="chat-input-media-uploader"]').should('not.be.visible'); - cy.get('[data-cy="markdownHint"]').should('have.css', 'opacity', '0'); - - const newMessage = 'A new message!'; - cy.get('[contenteditable="true"]').type(newMessage); - cy.get('[data-cy="markdownHint"]').should('have.css', 'opacity', '1'); - // Wait for the messages to be loaded before sending new message - cy.get('[data-cy="message-group"]').should('be.visible'); - cy.get('[data-cy="chat-input-send-button"]').click(); - cy.contains('Sign in'); + cy.get('[data-cy="join-channel-login-upsell"]').should('be.visible'); + cy.get('[data-cy="thread-join-channel-upsell-button"]').should( + 'be.visible' + ); + cy.get('[data-cy="thread-join-channel-upsell-button"]').click(); + cy.get('[data-cy="login-modal"]').should('be.visible'); }); }); diff --git a/cypress/integration/thread_spec.js b/cypress/integration/thread_spec.js index 426098f1d1..262a8c2852 100644 --- a/cypress/integration/thread_spec.js +++ b/cypress/integration/thread_spec.js @@ -52,11 +52,12 @@ describe('Thread View', () => { it('should prompt logged-out users to log in', () => { const newMessage = 'A new message!'; cy.get('[data-cy="thread-view"]').should('be.visible'); - cy.get('[contenteditable="true"]').type(newMessage); - // Wait for the messages to be loaded before sending new message - cy.get('[data-cy="message-group"]').should('be.visible'); - cy.get('[data-cy="chat-input-send-button"]').click(); - cy.contains('Sign in'); + cy.get('[data-cy="join-channel-login-upsell"]').should('be.visible'); + cy.get('[data-cy="thread-join-channel-upsell-button"]').should( + 'be.visible' + ); + cy.get('[data-cy="thread-join-channel-upsell-button"]').click(); + cy.get('[data-cy="login-modal"]').should('be.visible'); }); }); @@ -442,7 +443,7 @@ describe('edit message signed in', () => { }); }); -describe('/new/thread', () => { +describe.only('/new/thread', () => { beforeEach(() => { cy.auth(author.id).then(() => cy.visit('/new/thread')); }); diff --git a/desktop/package.json b/desktop/package.json index 1d62f81233..9ae1b2b213 100644 --- a/desktop/package.json +++ b/desktop/package.json @@ -19,9 +19,9 @@ }, "devDependencies": { "electron": "^3.0.13", - "electron-builder": "^20.38.3", + "electron-builder": "^20.38.4", "nodemon": "^1.18.9", - "rimraf": "^2.6.2" + "rimraf": "^2.6.3" }, "scripts": { "dev": "nodemon --exec \"electron ./src/main.js\" -w ./src", diff --git a/desktop/yarn.lock b/desktop/yarn.lock index bbf0f6d12e..e8152304a7 100644 --- a/desktop/yarn.lock +++ b/desktop/yarn.lock @@ -69,7 +69,42 @@ app-builder-bin@2.6.0: resolved "https://registry.yarnpkg.com/app-builder-bin/-/app-builder-bin-2.6.0.tgz#b4e5d5ee5bcf264818ab9830b95338f9f419de5d" integrity sha512-7HphDMS2U9MwAA6R7lSU6MASFR/D+VJDb5hQ4Fn2coOMyaRn71QDWPdG0TPnDr88F2I7bsTuHYud28S/yN2lZw== -app-builder-lib@20.38.3, app-builder-lib@~20.38.3: +app-builder-bin@2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/app-builder-bin/-/app-builder-bin-2.6.1.tgz#aa97f82d341dfa6f1269d78955482d619cc613ed" + integrity sha512-W0l85O+s6lOaziWqAhszPfwiG0s15FvMBP9j9i/bknsMccUkwN60u4Cy7yYtf6akCUDuJenLqpTX4/xvkq1egw== + +app-builder-lib@20.38.4: + version "20.38.4" + resolved "https://registry.yarnpkg.com/app-builder-lib/-/app-builder-lib-20.38.4.tgz#71a515d01f4f2bd48a67495804f659a46c35303c" + integrity sha512-JbuAJQBndcCW6BJVIb2tPjM5wiuIjz2LUlbyVxNIawM2wFKUBV9kr0N3RNBJFxcrCEuA9oprMUCoymJdrMUVfA== + dependencies: + "7zip-bin" "~4.1.0" + app-builder-bin "2.6.1" + async-exit-hook "^2.0.1" + bluebird-lst "^1.0.6" + builder-util "9.6.1" + builder-util-runtime "8.1.0" + chromium-pickle-js "^0.2.0" + debug "^4.1.0" + ejs "^2.6.1" + electron-osx-sign "0.4.11" + electron-publish "20.38.3" + fs-extra-p "^7.0.0" + hosted-git-info "^2.7.1" + is-ci "^2.0.0" + isbinaryfile "^3.0.3" + js-yaml "^3.12.0" + lazy-val "^1.0.3" + minimatch "^3.0.4" + normalize-package-data "^2.4.0" + plist "^3.0.1" + read-config-file "3.2.0" + sanitize-filename "^1.6.1" + semver "^5.6.0" + temp-file "^3.3.2" + +app-builder-lib@~20.38.3: version "20.38.3" resolved "https://registry.yarnpkg.com/app-builder-lib/-/app-builder-lib-20.38.3.tgz#3998cbe07cad6eb45918eba43aa6313bf6cc15c2" integrity sha512-xZTzWgH2pDUfic9KAv17julgp4/HVD451AzYdyFcwGTrDvLjoZee2Ua6/Els88GKbH3QIkpntJEn5gCwdc4O9A== @@ -326,6 +361,24 @@ builder-util@9.6.0, builder-util@~9.6.0: stat-mode "^0.2.2" temp-file "^3.3.2" +builder-util@9.6.1: + version "9.6.1" + resolved "https://registry.yarnpkg.com/builder-util/-/builder-util-9.6.1.tgz#4625620b1535fe40dcacb178d24fe56d0d7c8957" + integrity sha512-8MljKTjeV+A+LLVexuWEV3EpWbiUcsHHrB4Bg2qNo/3dC+vTo6g/27+W3Ij7Ij1UTobSkNBstFieWijXJCco9A== + dependencies: + "7zip-bin" "~4.1.0" + app-builder-bin "2.6.1" + bluebird-lst "^1.0.6" + builder-util-runtime "^8.1.0" + chalk "^2.4.1" + debug "^4.1.0" + fs-extra-p "^7.0.0" + is-ci "^2.0.0" + js-yaml "^3.12.0" + source-map-support "^0.5.9" + stat-mode "^0.2.2" + temp-file "^3.3.2" + builtin-modules@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" @@ -714,14 +767,14 @@ ejs@^2.6.1: resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.6.1.tgz#498ec0d495655abc6f23cd61868d926464071aa0" integrity sha512-0xy4A/twfrRCnkhfk8ErDi5DqdAsAqeGxht4xkCUrsvhhbQNs7E+4jV0CN7+NKIY0aHE72+XvqtBIXzD31ZbXQ== -electron-builder@^20.38.3: - version "20.38.3" - resolved "https://registry.yarnpkg.com/electron-builder/-/electron-builder-20.38.3.tgz#32eaa08575b5036e4dafc78adef25ff5a7370004" - integrity sha512-KVM90FtSmryi6JT+YEOTJPsB34ZPdrJn2X18Rt8uatSQPj4vVCSwT834cyvF79idRea8yRVoMcm69XtH9VNPjg== +electron-builder@^20.38.4: + version "20.38.4" + resolved "https://registry.yarnpkg.com/electron-builder/-/electron-builder-20.38.4.tgz#67727529ffb87e7fdd78b3a84ea0d6c22bf04ec2" + integrity sha512-WHOr3Rz2wktxV5TqmRL6woO9/wrIZeRfJPSEXOhgfgLskE5Sp2Aer0zAF7lHNqXuG6JhU+0I9IYFAxa73MTs9w== dependencies: - app-builder-lib "20.38.3" + app-builder-lib "20.38.4" bluebird-lst "^1.0.6" - builder-util "9.6.0" + builder-util "9.6.1" builder-util-runtime "8.1.0" chalk "^2.4.1" dmg-builder "6.5.3" @@ -1143,7 +1196,7 @@ glob-parent@^3.1.0: is-glob "^3.1.0" path-dirname "^1.0.0" -glob@^7.0.5: +glob@^7.0.5, glob@^7.1.3: version "7.1.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== @@ -2483,13 +2536,20 @@ ret@~0.1.10: resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== -rimraf@^2.6.1, rimraf@^2.6.2: +rimraf@^2.6.1: version "2.6.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" integrity sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w== dependencies: glob "^7.0.5" +rimraf@^2.6.3: + version "2.6.3" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" + integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== + dependencies: + glob "^7.1.3" + safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" diff --git a/hermes/package.json b/hermes/package.json index d874036531..696fc149c2 100644 --- a/hermes/package.json +++ b/hermes/package.json @@ -4,10 +4,10 @@ }, "dependencies": { "@sendgrid/mail": "^6.3.1", - "aws-sdk": "^2.373.0", + "aws-sdk": "^2.383.0", "bull": "3.3.10", "datadog-metrics": "^0.8.1", - "debug": "^4.1.0", + "debug": "^4.1.1", "draft-js": "^0.10.5", "escape-html": "^1.0.3", "faker": "^4.1.0", @@ -16,14 +16,16 @@ "lodash.intersection": "^4.4.0", "node-env-file": "^0.1.8", "now-env": "^3.1.0", + "performance-now": "^2.1.0", "raven": "^2.6.4", "redis-tag-cache": "^1.2.1", + "rethinkdb-inspector": "^0.3.3", "rethinkdbdash": "^2.3.31", "rethinkhaberdashery": "^2.3.32", "sanitize-filename": "^1.6.1", "source-map-support": "^0.4.18", "toobusy-js": "^0.5.1", - "validator": "^10.9.0" + "validator": "^10.10.0" }, "devDependencies": { "json-stringify-pretty-compact": "^1.2.0" diff --git a/hermes/yarn.lock b/hermes/yarn.lock index 8ad3e6da55..d63bb3bc8c 100644 --- a/hermes/yarn.lock +++ b/hermes/yarn.lock @@ -98,10 +98,10 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= -aws-sdk@^2.373.0: - version "2.373.0" - resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.373.0.tgz#fcc5606634b3b11d80810ad252d1b52b3733d780" - integrity sha512-NZYXwXGtFt9jxaKXc+PJsLPnpbD03t0MAZRxh93g36kbFMuRXtY8CDqHYNQ0ZcrgQpXbCQiz1fxT5/wu5Cu70g== +aws-sdk@^2.383.0: + version "2.383.0" + resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.383.0.tgz#86045c0a4a4898dca84a4877cbe765b7dc0f8bba" + integrity sha512-PN+s+NTABtBloS46c7C2dvoEzrdY2NZ5nsfljL3xDX2rvjJEQxdchS2jcCpyc5ZNudFwta66wY4EGBZqf4Attw== dependencies: buffer "4.9.1" events "1.1.1" @@ -279,10 +279,10 @@ debug@^3.1.0: dependencies: ms "^2.1.1" -debug@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.0.tgz#373687bffa678b38b1cd91f861b63850035ddc87" - integrity sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg== +debug@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== dependencies: ms "^2.1.1" @@ -997,6 +997,11 @@ request@^2.81.0: tunnel-agent "^0.6.0" uuid "^3.3.2" +rethinkdb-inspector@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/rethinkdb-inspector/-/rethinkdb-inspector-0.3.3.tgz#f0d88c66d17e0234b5518ca51cd8c272cb787003" + integrity sha512-1R0S5maattWOptfkHsU5ulXnt6FIKqjgyEdd8WgW9QbYMiHaXNqkHTAsmtXXSAf0j5iFH3F2qq/7eg4xwb8Euw== + rethinkdbdash@^2.3.31: version "2.3.31" resolved "https://registry.yarnpkg.com/rethinkdbdash/-/rethinkdbdash-2.3.31.tgz#fe2f73d1fa6e6f5d96d8e881292013cf6dca914d" @@ -1169,10 +1174,10 @@ uuid@3.3.2, uuid@^3.1.0, uuid@^3.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== -validator@^10.9.0: - version "10.9.0" - resolved "https://registry.yarnpkg.com/validator/-/validator-10.9.0.tgz#d10c11673b5061fb7ccf4c1114412411b2bac2a8" - integrity sha512-hZJcZSWz9poXBlAkjjcsNAdrZ6JbjD3kWlNjq/+vE7RLLS/+8PAj3qVVwrwsOz/WL8jPmZ1hYkRvtlUeZAm4ug== +validator@^10.10.0: + version "10.10.0" + resolved "https://registry.yarnpkg.com/validator/-/validator-10.10.0.tgz#a69ac298149f063a44361cb52182edb52dab59a4" + integrity sha512-DyZyLJlMXM3CGdVaVHE/EDzCagMRoPI3mmGdxxNQbqkGqh56+M3d1i0ZAWd69En8U21DHbPTn12aOdhO+hfm5w== verror@1.10.0: version "1.10.0" diff --git a/mercury/package.json b/mercury/package.json index aeb0c229bc..85df64bea7 100644 --- a/mercury/package.json +++ b/mercury/package.json @@ -5,11 +5,13 @@ "dependencies": { "bull": "^3.5.2", "datadog-metrics": "^0.8.1", - "debug": "^4.1.0", + "debug": "^4.1.1", "ioredis": "3.2.2", "now-env": "^3.1.0", + "performance-now": "^2.1.0", "raven": "^2.6.4", "redis-tag-cache": "^1.2.1", + "rethinkdb-inspector": "^0.3.3", "rethinkdbdash": "^2.3.31", "rethinkhaberdashery": "^2.3.32", "source-map-support": "^0.4.18", diff --git a/mercury/yarn.lock b/mercury/yarn.lock index 17b6f3e47b..038015f5b5 100644 --- a/mercury/yarn.lock +++ b/mercury/yarn.lock @@ -82,10 +82,10 @@ debug@^3.1.0: dependencies: ms "^2.1.1" -debug@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.0.tgz#373687bffa678b38b1cd91f861b63850035ddc87" - integrity sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg== +debug@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== dependencies: ms "^2.1.1" @@ -336,6 +336,11 @@ object-keys@^1.0.12: resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2" integrity sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag== +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= + raven@^2.6.4: version "2.6.4" resolved "https://registry.yarnpkg.com/raven/-/raven-2.6.4.tgz#458d4a380c8fbb59e0150c655625aaf60c167ea3" @@ -386,6 +391,11 @@ redis-tag-cache@^1.2.1: dependencies: ioredis "^4.0.0" +rethinkdb-inspector@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/rethinkdb-inspector/-/rethinkdb-inspector-0.3.3.tgz#f0d88c66d17e0234b5518ca51cd8c272cb787003" + integrity sha512-1R0S5maattWOptfkHsU5ulXnt6FIKqjgyEdd8WgW9QbYMiHaXNqkHTAsmtXXSAf0j5iFH3F2qq/7eg4xwb8Euw== + rethinkdbdash@^2.3.31: version "2.3.31" resolved "https://registry.yarnpkg.com/rethinkdbdash/-/rethinkdbdash-2.3.31.tgz#fe2f73d1fa6e6f5d96d8e881292013cf6dca914d" diff --git a/package.json b/package.json index f617c42f37..9b3993389d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Spectrum", - "version": "2.5.5", + "version": "2.5.6", "license": "BSD-3-Clause", "devDependencies": { "@babel/preset-flow": "^7.0.0", diff --git a/shared/bull/create-queue.js b/shared/bull/create-queue.js index eea7fdc048..ccf8767b3f 100644 --- a/shared/bull/create-queue.js +++ b/shared/bull/create-queue.js @@ -2,6 +2,7 @@ const Queue = require('bull'); import createRedis from './create-redis'; import Raven from 'shared/raven'; +import { statsd } from 'shared/statsd'; const client = createRedis(); const subscriber = createRedis(); @@ -29,16 +30,52 @@ function createQueue(name: string, queueOptions?: Object = {}) { queue.on('stalled', job => { console.error(`Job#${job.id} stalled, processing again.`); console.error({ job }); + statsd.increment('jobs.active', -1, { + queue: name, + }); + }); + queue.on('waiting', () => { + statsd.increment('jobs.waiting', 1, { + queue: name, + }); + }); + queue.on('active', () => { + statsd.increment('jobs.waiting', -1, { + queue: name, + }); + statsd.increment('jobs.active', 1, { + queue: name, + }); + }); + queue.on('completed', () => { + statsd.increment('jobs.active', -1, { + queue: name, + }); + statsd.increment('jobs.completed', 1, { + queue: name, + }); }); queue.on('error', err => { console.error('Job errored'); console.error({ err }); Raven.captureException(new Error(err)); + statsd.increment('jobs.active', -1, { + queue: name, + }); + statsd.increment('jobs.errored', 1, { + queue: name, + }); }); queue.on('failed', (job, err) => { console.error(`Job#${job.id} failed, with following reason`); console.error({ job, err }); Raven.captureException(err); + statsd.increment('jobs.active', -1, { + queue: name, + }); + statsd.increment('jobs.failed', 1, { + queue: name, + }); }); return queue; } diff --git a/src/components/maintenance/index.js b/src/components/maintenance/index.js index 99f8787087..b644a29079 100644 --- a/src/components/maintenance/index.js +++ b/src/components/maintenance/index.js @@ -35,7 +35,6 @@ const Text = styled(Copy)` `; const MaintenanceDowntime = () => { - const timeInUTC = 'September 25, 2017 15:00:00 UTC'; return ( diff --git a/src/components/threadFeed/index.js b/src/components/threadFeed/index.js index 994627e227..341f23d52c 100644 --- a/src/components/threadFeed/index.js +++ b/src/components/threadFeed/index.js @@ -14,7 +14,7 @@ import { NullCard } from '../upsell'; import { LoadingInboxThread } from '../loading'; import NewActivityIndicator from '../newActivityIndicator'; import ViewError from '../viewError'; -import { Upsell, UpsellHeader, UpsellFooter } from './style'; +import { Upsell, UpsellHeader, UpsellFooter, UpsellBlock } from './style'; import type { GetCommunityType } from 'shared/graphql/queries/community/getCommunity'; import type { Dispatch } from 'redux'; import { ErrorBoundary } from 'src/components/error'; @@ -66,7 +66,7 @@ const UpsellState = ({ community }) => (

First things first, you’ll want to start a couple threads.

-

+ Open-ended questions are a great start, for example:

  • ask new members to introduce themselves
  • @@ -75,7 +75,7 @@ const UpsellState = ({ community }) => (
  • ask for suggestions on a problem you’re facing
-

+

Once you’ve got a couple threads started, make sure to{' '} help people find your community. Talking about your community on diff --git a/src/components/threadFeed/style.js b/src/components/threadFeed/style.js index 4bcc94334b..344fcbc9eb 100644 --- a/src/components/threadFeed/style.js +++ b/src/components/threadFeed/style.js @@ -93,4 +93,16 @@ export const UpsellHeader = styled.div` } `; +export const UpsellBlock = styled.div` + margin-top: 16px; + ul { + padding: 16px 0; + padding-left: 32px; + } + + li { + margin-top: 8px; + } +`; + export const UpsellFooter = styled.div``; diff --git a/src/components/upsell/joinChannel.js b/src/components/upsell/joinChannel.js index 76793035ee..f48f1af01f 100644 --- a/src/components/upsell/joinChannel.js +++ b/src/components/upsell/joinChannel.js @@ -4,21 +4,24 @@ import { connect } from 'react-redux'; import compose from 'recompose/compose'; import toggleChannelSubscriptionMutation from 'shared/graphql/mutations/channel/toggleChannelSubscription'; import type { ToggleChannelSubscriptionType } from 'shared/graphql/mutations/channel/toggleChannelSubscription'; -import { addToastWithTimeout } from '../../actions/toasts'; +import { addToastWithTimeout } from 'src/actions/toasts'; +import { openModal } from 'src/actions/modals'; import type { Dispatch } from 'redux'; +import { withCurrentUser } from 'src/components/withCurrentUser'; import { JoinChannelContainer, JoinChannelContent, JoinChannelTitle, JoinChannelSubtitle, } from './style'; -import { Button } from '../buttons'; +import { Button } from 'src/components/buttons'; type Props = { channel: Object, community: Object, toggleChannelSubscription: Function, dispatch: Dispatch, + currentUser: ?Object, }; type State = { @@ -34,6 +37,8 @@ class JoinChannel extends React.Component { }; } + login = () => this.props.dispatch(openModal('CHAT_INPUT_LOGIN_MODAL')); + toggleSubscription = () => { const { channel, dispatch } = this.props; @@ -89,7 +94,26 @@ class JoinChannel extends React.Component { render() { const { isLoading } = this.state; - const { channel, community } = this.props; + const { channel, community, currentUser } = this.props; + + if (!currentUser) { + return ( + + + Log in or sign up to chat + + + + + ); + } + return ( @@ -116,5 +140,6 @@ class JoinChannel extends React.Component { export default compose( connect(), + withCurrentUser, toggleChannelSubscriptionMutation )(JoinChannel); diff --git a/src/components/usernameSearch/index.js b/src/components/usernameSearch/index.js index 7ed43e4bdb..4be50429ab 100644 --- a/src/components/usernameSearch/index.js +++ b/src/components/usernameSearch/index.js @@ -15,7 +15,11 @@ type Props = { username: string, label: string, size: string, - onValidationResult: ({ error: string, success: string }) => void, + onValidationResult: ({ + error: string, + success: string, + username?: string, + }) => void, onError: ?(err: Error) => void, dataCy?: string, }; diff --git a/src/views/thread/container.js b/src/views/thread/container.js index 6c396247b3..7f4d72cdaa 100644 --- a/src/views/thread/container.js +++ b/src/views/thread/container.js @@ -327,21 +327,19 @@ class ThreadContainer extends React.Component { ); - if (!currentUser) { - return chatInputComponent; - } + const joinLoginUpsell = ( + + ); - if (currentUser && !currentUser.id) { - return chatInputComponent; + if (!currentUser || !currentUser.id) { + return joinLoginUpsell; } if (channelPermissions.isMember) { return chatInputComponent; } - return ( - - ); + return joinLoginUpsell; }; renderPost = () => { diff --git a/vulcan/package.json b/vulcan/package.json index 2c5d822b6e..93aafe5069 100644 --- a/vulcan/package.json +++ b/vulcan/package.json @@ -4,10 +4,10 @@ }, "dependencies": { "algoliasearch": "^3.32.0", - "aws-sdk": "^2.373.0", + "aws-sdk": "^2.383.0", "bull": "^3.5.2", "datadog-metrics": "^0.8.1", - "debug": "^4.1.0", + "debug": "^4.1.1", "draft-js": "^0.10.3", "emoji-regex": "^6.1.1", "faker": "^4.1.0", @@ -16,9 +16,11 @@ "lodash.intersection": "^4.4.0", "node-env-file": "^0.1.8", "now-env": "^3.1.0", + "performance-now": "^2.1.0", "raven": "^2.6.4", "redis-tag-cache": "^1.2.1", "rethinkdb-changefeed-reconnect": "^0.3.2", + "rethinkdb-inspector": "^0.3.3", "rethinkdbdash": "^2.3.31", "rethinkhaberdashery": "^2.3.32", "sanitize-filename": "^1.6.1", diff --git a/vulcan/yarn.lock b/vulcan/yarn.lock index 672e20cae7..10413f92ba 100644 --- a/vulcan/yarn.lock +++ b/vulcan/yarn.lock @@ -33,10 +33,10 @@ asap@~2.0.3: resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY= -aws-sdk@^2.373.0: - version "2.373.0" - resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.373.0.tgz#fcc5606634b3b11d80810ad252d1b52b3733d780" - integrity sha512-NZYXwXGtFt9jxaKXc+PJsLPnpbD03t0MAZRxh93g36kbFMuRXtY8CDqHYNQ0ZcrgQpXbCQiz1fxT5/wu5Cu70g== +aws-sdk@^2.383.0: + version "2.383.0" + resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.383.0.tgz#86045c0a4a4898dca84a4877cbe765b7dc0f8bba" + integrity sha512-PN+s+NTABtBloS46c7C2dvoEzrdY2NZ5nsfljL3xDX2rvjJEQxdchS2jcCpyc5ZNudFwta66wY4EGBZqf4Attw== dependencies: buffer "4.9.1" events "1.1.1" @@ -160,10 +160,10 @@ debug@^3.1.0: dependencies: ms "^2.1.1" -debug@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.0.tgz#373687bffa678b38b1cd91f861b63850035ddc87" - integrity sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg== +debug@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== dependencies: ms "^2.1.1" @@ -596,6 +596,11 @@ object-keys@^1.0.11, object-keys@^1.0.12, object-keys@~1.0.0: resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2" integrity sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag== +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= + process@~0.5.1: version "0.5.2" resolved "https://registry.yarnpkg.com/process/-/process-0.5.2.tgz#1638d8a8e34c2f440a91db95ab9aeb677fc185cf" @@ -692,6 +697,11 @@ rethinkdb-changefeed-reconnect@^0.3.2: dependencies: babel-runtime "^6.18.0" +rethinkdb-inspector@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/rethinkdb-inspector/-/rethinkdb-inspector-0.3.3.tgz#f0d88c66d17e0234b5518ca51cd8c272cb787003" + integrity sha512-1R0S5maattWOptfkHsU5ulXnt6FIKqjgyEdd8WgW9QbYMiHaXNqkHTAsmtXXSAf0j5iFH3F2qq/7eg4xwb8Euw== + rethinkdbdash@^2.3.31: version "2.3.31" resolved "https://registry.yarnpkg.com/rethinkdbdash/-/rethinkdbdash-2.3.31.tgz#fe2f73d1fa6e6f5d96d8e881292013cf6dca914d"