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

2.7.4 #4732

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
1100067
Create first prototype thread renderer
Feb 12, 2019
dd5a254
Create ThreadRenderer component
Feb 12, 2019
1e1f167
Add embed support to thread renderer
Feb 12, 2019
fd1473f
Add support for links and mentions back
Feb 12, 2019
ce5a936
Fix paragraph rendering and render h3s
Feb 12, 2019
84f9ec0
Code cleanup
Feb 12, 2019
0cb6f95
Flowtype keys
Feb 12, 2019
61be799
Fix codeblock styling
Feb 12, 2019
3fbd467
Remove console.log
Feb 12, 2019
3c079df
Render images
Feb 12, 2019
0695e17
Delete rich-text-editor import from composer
Feb 12, 2019
9520f0c
Use ThreadRenderer in ThreadDetail
Feb 12, 2019
806858c
Delete unused rich-text-editor and draft-js-plugins-editor components
Feb 12, 2019
243347f
Move thread composer inputs to separate component
Feb 12, 2019
9cbdc26
Remove console.log
Feb 12, 2019
4ba6a6b
Make plaintext thread editing work!!!
Feb 12, 2019
68c5f47
Remove draftjs CSS
Feb 12, 2019
4bc03b7
Remove unnecessary conversion to draftjs for emoji messages'
Feb 12, 2019
6728ea7
Remove usage of KeyBindingUtil from thread composer
Feb 12, 2019
51f3d3a
Remove unused imports to draft-utils
Feb 12, 2019
c4f92cd
Remove last usage of draft-utils/index.js in src/
Feb 12, 2019
7ab795c
Add syntax highlighting back
Feb 13, 2019
c2277d5
remove console.log
Feb 18, 2019
ae7c3ba
Merge branch 'alpha' into thread-renderer
Feb 18, 2019
4f5f0f0
fix bug: upload community cover photo will cause this photo be saved …
tuoxiansp Feb 18, 2019
c5e08c9
Pass along an error message if existing user has github credentials
brianlovin Feb 19, 2019
9762a93
Append the error message as a query param to the redirect path
brianlovin Feb 19, 2019
549b412
Parse error message from query param and pass down to github button t…
brianlovin Feb 19, 2019
fdd7307
Underline links in error message
brianlovin Feb 19, 2019
b60717b
Supress flow
brianlovin Feb 19, 2019
d0963d9
Run now rm --safe after deploys
Feb 20, 2019
8d6efcd
Revert "Revert "Add request-level rate limiting""
mxstbr Feb 20, 2019
f248e90
Merge branch 'alpha' of github.com:withspectrum/spectrum into github-…
brianlovin Feb 20, 2019
65b87ab
Use generic toast params on auth error
brianlovin Feb 20, 2019
294a20f
Add generic query param toast dispatcher component
brianlovin Feb 20, 2019
d875ec1
Let the global query param toast dispatcher handle github auth error
brianlovin Feb 20, 2019
788143b
Implement redirects with toasts from all email routes
brianlovin Feb 20, 2019
6ba332e
Hot fix signthread bug
brianlovin Feb 20, 2019
346bde6
Merge pull request #4706 from withspectrum/hotfix-signthread-bug
brianlovin Feb 20, 2019
cff893a
Dont use firstnamelastname on empty user profile thread feed
brianlovin Feb 20, 2019
9d6c323
Visual polish on toasts
brianlovin Feb 21, 2019
fe30164
Increase toast duration
brianlovin Feb 21, 2019
f8dbc2f
Add tests for query param toast handler
brianlovin Feb 21, 2019
87bae57
Decode cleaned search params to preserve the original url
brianlovin Feb 21, 2019
418f3fa
Fix flow
brianlovin Feb 21, 2019
5043120
feat: Add close button to hide thread upsell
arthurdenner Feb 21, 2019
a96a4fd
Do not log statsd (or any other middleware) from workers
Feb 21, 2019
0020d04
Merge pull request #4707 from withspectrum/remove-use-of-first-last-name
mxstbr Feb 21, 2019
872d7b4
Merge pull request #4679 from withspectrum/github-connection-error
mxstbr Feb 21, 2019
8ceab44
Fix old links
Feb 21, 2019
a504dc3
Merge pull request #4709 from withspectrum/brian-is-annoyed-by-the-lo…
mxstbr Feb 21, 2019
7f40004
Fix e2e test
Feb 21, 2019
a26d59c
Remove names from pkg.json of athena and analytis
Feb 21, 2019
1382468
Fix flow
Feb 21, 2019
296f9d6
Merge branch 'alpha' into revert-4660-revert-4647-node-rate-limits
Feb 21, 2019
afb430c
Update hyperion error page
Feb 21, 2019
3c6ff6c
Do not rate limit static files from hyperion
Feb 21, 2019
c2de592
Fix data-cy selector in action bar spec
Feb 21, 2019
50bf924
Double rate limits for hyperion
Feb 21, 2019
9c0e418
Merge pull request #4687 from withspectrum/run-rm-after-deploy
brianlovin Feb 21, 2019
ce3b080
Update jsonwebtoken to version 8.5.0
depfu[bot] Feb 21, 2019
663d412
Simplify thread join upsell
brianlovin Feb 21, 2019
203d55b
Remove unneeded component
brianlovin Feb 21, 2019
d513fea
Merge pull request #4714 from withspectrum/depfu/update/hermes/yarn/j…
brianlovin Feb 21, 2019
24255b8
Polish editor layout in editing mode
brianlovin Feb 21, 2019
34deefe
Fix unsubscribe redirects for individual entity mutes
brianlovin Feb 21, 2019
364d371
Dont flag spam for one deleted thread
brianlovin Feb 21, 2019
0c7e87a
Fix loading state on DMs
brianlovin Feb 21, 2019
8eb52d2
Fix flow
brianlovin Feb 21, 2019
218cf0b
Merge pull request #4664 from tuoxiansp/important-fix
brianlovin Feb 21, 2019
9674f0f
Update jsonwebtoken to version 8.5.0
depfu[bot] Feb 21, 2019
14f820e
Fix e2e
brianlovin Feb 21, 2019
0f62e81
Merge pull request #4713 from withspectrum/depfu/update/api/yarn/json…
brianlovin Feb 21, 2019
f7e0e34
Persist last selected inbox community between sessions
brianlovin Feb 21, 2019
7c6d8e8
Add logout button to mobile user settings
brianlovin Feb 21, 2019
8fb6522
Styling polish
brianlovin Feb 21, 2019
bd4010b
Merge pull request #4708 from arthurdenner/feat/hide-thread-upsell
brianlovin Feb 21, 2019
62ca6ee
Merge pull request #4716 from withspectrum/better-spam
mxstbr Feb 22, 2019
950e5f5
Merge pull request #4719 from withspectrum/logout-on-mobile
mxstbr Feb 22, 2019
22a232e
Merge pull request #4715 from withspectrum/fix-email-unsub-redirects
mxstbr Feb 22, 2019
520ecc7
Merge pull request #4717 from withspectrum/fix-dm-loading-state
mxstbr Feb 22, 2019
95eb358
Clean up block rendering
Feb 22, 2019
0fa35d2
Clean up block rendering
Feb 22, 2019
c990991
Log GraphQL error stack trace in development
Feb 22, 2019
8a1989c
Fix deleting thread body on edit
Feb 22, 2019
34bd866
Clean up cmd+esc handling
Feb 22, 2019
b23618a
Move localStorage setting to action dispatcher
brianlovin Feb 22, 2019
9589812
Layout and overflow fixes abound
brianlovin Feb 22, 2019
5690d36
Merge pull request #4718 from withspectrum/persist-inbox-community-se…
mxstbr Feb 22, 2019
3dac85c
Update aws-sdk to version 2.409.0
depfu[bot] Feb 22, 2019
003ce90
Update aws-sdk to version 2.409.0
depfu[bot] Feb 23, 2019
18aff56
Update aws-sdk to version 2.409.0
depfu[bot] Feb 23, 2019
49cba24
Update apollo-server-express to version 2.4.6
depfu[bot] Feb 23, 2019
4089245
Merge pull request #4731 from withspectrum/depfu/update/api/yarn/apol…
brianlovin Feb 23, 2019
0d7b7e4
Merge pull request #4730 from withspectrum/depfu/update/vulcan/yarn/a…
brianlovin Feb 23, 2019
7a185c9
Merge pull request #4729 from withspectrum/depfu/update/hermes/yarn/a…
brianlovin Feb 23, 2019
1770804
Merge pull request #4727 from withspectrum/depfu/update/athena/yarn/a…
brianlovin Feb 23, 2019
36a0f96
Show fenced code blocks on thread edit
Feb 25, 2019
963d82c
Increase hyperion rate limits by a nudge
Feb 25, 2019
1685837
Merge pull request #4692 from withspectrum/revert-4660-revert-4647-no…
mxstbr Feb 25, 2019
c34bb1f
Merge pull request #4629 from withspectrum/thread-renderer
brianlovin Feb 25, 2019
3649fea
Update aws-sdk to version 2.409.0
depfu[bot] Feb 25, 2019
e784256
Update aws-sdk to version 2.409.0
depfu[bot] Feb 25, 2019
4219ba1
Merge pull request #4726 from withspectrum/depfu/update/analytics/yar…
brianlovin Feb 25, 2019
ad82a5a
Merge pull request #4728 from withspectrum/depfu/update/chronos/yarn/…
brianlovin Feb 25, 2019
c67950f
Merge branch 'alpha' of github.com:withspectrum/spectrum into 2.7.4
brianlovin Feb 25, 2019
ad2c530
2.7.4
brianlovin Feb 25, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions analytics/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"name": "analytics",
"version": "1.0.0",
"scripts": {
"start": "NODE_ENV=production node main.js"
},
"dependencies": {
"amplitude": "^3.5.0",
"aws-sdk": "^2.395.0",
"aws-sdk": "^2.409.0",
"bull": "3.3.10",
"datadog-metrics": "^0.8.1",
"debug": "^4.1.1",
Expand Down
8 changes: 4 additions & 4 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.395.0:
version "2.395.0"
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.395.0.tgz#637e5fa06d69bfb923b17bde24a8bd2a74dedab3"
integrity sha512-ldTTjctniZT4E2lq2z3D8Y2u+vpkp+laoEnDkXgjKXTKbiJ0QEtfWsUdx/IQ7awCt8stoxyqZK47DJOxIbRNoA==
aws-sdk@^2.409.0:
version "2.409.0"
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.409.0.tgz#d017060ba9e005487c68dc34a592af74d916f295"
integrity sha512-QV6j9zBQq/Kz8BqVOrJ03ABjMKtErXdUT1YdYEljoLQZimpzt0ZdQwJAsoZIsxxriOJgrqeZsQUklv9AFQaldQ==
dependencies:
buffer "4.9.1"
events "1.1.1"
Expand Down
16 changes: 9 additions & 7 deletions api/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,11 @@ const init = () => {
const githubUsername =
profile.username || profile._json.login || fallbackUsername;

const existingUserWithProviderId = await getUserByIndex(
'githubProviderId',
profile.id
);

if (req.user) {
// if a user exists in the request body, it means the user is already
// authed and is trying to connect a github account. Before we do so
Expand All @@ -302,7 +307,6 @@ const init = () => {
// 2. The providerId returned from GitHub isnt' being used by another user

// 1
// if the user already has a githubProviderId, don't override it
if (req.user.githubProviderId) {
/*
Update the cached content of the github profile that we store
Expand Down Expand Up @@ -333,11 +337,6 @@ const init = () => {
return done(null, req.user);
}

const existingUserWithProviderId = await getUserByIndex(
'githubProviderId',
profile.id
);

// 2
// if no user exists with this provider id, it's safe to save on the req.user's object
if (!existingUserWithProviderId) {
Expand All @@ -359,7 +358,10 @@ const init = () => {

// if a user exists with this provider id, don't do anything and return
if (existingUserWithProviderId) {
return done(null, req.user);
return done(null, req.user, {
message:
'Your GitHub account is already linked to another Spectrum profile.',
});
}
}

Expand Down
8 changes: 8 additions & 0 deletions api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { init as initPassport } from './authentication.js';
import apolloServer from './apollo-server';
import { corsOptions } from 'shared/middlewares/cors';
import errorHandler from 'shared/middlewares/error-handler';
import rateLimiter from 'shared/middlewares/rate-limiter';
import middlewares from './routes/middlewares';
import authRoutes from './routes/auth';
import apiRoutes from './routes/api';
Expand All @@ -43,6 +44,13 @@ app.use(statsd);
// Trust the now proxy
app.set('trust proxy', true);
app.use(toobusy);
// Allow bursts of up to 40 req for initial page loads, but block more than 40 / 10s
app.use(
rateLimiter({
max: 40,
duration: '10s',
})
);

// Security middleware.
addSecurityMiddleware(app, { enableNonce: false, enableCSP: false });
Expand Down
5 changes: 5 additions & 0 deletions api/mutations/thread/editThread.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @flow
const debug = require('debug')('api:mutations:edit-thread');
import type { GraphQLContext } from '../../';
import type { EditThreadInput } from '../../models/thread';
import UserError from '../../utils/UserError';
Expand All @@ -7,6 +8,7 @@ import { getThreads, editThread } from '../../models/thread';
import { getUserPermissionsInCommunity } from '../../models/usersCommunities';
import { getUserPermissionsInChannel } from '../../models/usersChannels';
import { isAuthedResolver as requireAuth } from '../../utils/permissions';
import processThreadContent from 'shared/draft-utils/process-thread-content';
import { events } from 'shared/analytics';
import { trackQueue } from 'shared/bull/queues';
import {
Expand Down Expand Up @@ -83,6 +85,8 @@ export default requireAuth(async (_: any, args: Input, ctx: GraphQLContext) => {
);
}

input.content.body = processThreadContent('TEXT', input.content.body || '');

/*
When threads are sent to the client, all image urls are signed and proxied
via imgix. If a user edits the thread, we have to restore all image upload
Expand Down Expand Up @@ -130,6 +134,7 @@ export default requireAuth(async (_: any, args: Input, ctx: GraphQLContext) => {
});
}

debug('store new body to database:', initialBody);
const newInput = Object.assign({}, input, {
...input,
content: {
Expand Down
6 changes: 6 additions & 0 deletions api/mutations/thread/publishThread.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@ export default requireAuth(

const checkForSpam = usersPreviousPublishedThreads.map(t => {
if (!t) return false;
if (
usersPreviousPublishedThreads.length === 1 &&
usersPreviousPublishedThreads[0] &&
usersPreviousPublishedThreads[0].deletedAt
)
return false;

const incomingTitle = thread.content.title;
const thisTitle = t.content.title;
Expand Down
5 changes: 3 additions & 2 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dependencies": {
"algoliasearch": "^3.32.0",
"apollo-local-query": "^0.3.1",
"apollo-server-express": "^2.4.2",
"apollo-server-express": "^2.4.6",
"apollo-upload-client": "^9.1.0",
"aws-sdk": "2.200.0",
"axios": "^0.16.2",
Expand Down Expand Up @@ -71,7 +71,7 @@
"iterall": "^1.2.2",
"jest": "^21.2.1",
"json-stringify-pretty-compact": "^1.2.0",
"jsonwebtoken": "^8.4.0",
"jsonwebtoken": "^8.5.0",
"keygrip": "^1.0.3",
"linkify-it": "^2.1.0",
"localstorage-memory": "^1.0.3",
Expand All @@ -92,6 +92,7 @@
"pre-commit": "^1.2.2",
"prismjs": "^1.15.0",
"query-string": "5.1.1",
"ratelimiter": "^3.2.0",
"raven": "^2.6.4",
"react": "^15.4.1",
"react-app-rewire-styled-components": "^3.0.2",
Expand Down
Loading