Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

Commit

Permalink
Merge pull request #4532 from withspectrum/2.5.6
Browse files Browse the repository at this point in the history
2.5.6
  • Loading branch information
brianlovin authored Jan 9, 2019
2 parents b1363bb + 632e765 commit c972275
Show file tree
Hide file tree
Showing 31 changed files with 348 additions and 128 deletions.
6 changes: 4 additions & 2 deletions analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
26 changes: 18 additions & 8 deletions analytics/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down
5 changes: 1 addition & 4 deletions api/routes/auth/google.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
30 changes: 21 additions & 9 deletions api/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
6 changes: 4 additions & 2 deletions athena/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
26 changes: 18 additions & 8 deletions athena/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
6 changes: 4 additions & 2 deletions chronos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
1 change: 1 addition & 0 deletions chronos/queues/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions chronos/queues/digests/getReputationString.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
12 changes: 11 additions & 1 deletion chronos/queues/digests/processThreads.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -108,10 +109,19 @@ export const attachScoreToThreads = async (
): Promise<Array<ThreadWithDigestData>> => {
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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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."`;
Loading

0 comments on commit c972275

Please sign in to comment.