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

2.2.6 #2882

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
282 commits
Select commit Hold shift + click to select a range
467dbb3
Change time range to 10 minutes for spam filter
brianlovin Apr 6, 2018
e7648fa
Clean up spam check logic
brianlovin Apr 6, 2018
858e41f
Switch to use loaders, fix small bug when body is empty
brianlovin Apr 6, 2018
b521604
Add leniency for community + channel mods and owners
brianlovin Apr 6, 2018
bfb8106
Send admins spam report emails to help fine tune constants
brianlovin Apr 6, 2018
ac9ac31
First implementation of platform level blocking
brianlovin Apr 6, 2018
5b3224a
[FIX] Better validation of username in SetUsername component when sen…
LetItRock Apr 7, 2018
4c45999
Paste image from clipboard into chat input
StefanNemeth Apr 7, 2018
c6897e7
Update draft-js-markdown-plugin
mxstbr Apr 7, 2018
8474335
Add inline markdown to messages
mxstbr Apr 7, 2018
45088c6
WIP: Implement better code block handling in messages
mxstbr Apr 7, 2018
3265d11
adds membership lists to the left profile column on mid-size displays…
superbryntendo Apr 7, 2018
853ae9a
Preview non-pasted media messages as well
StefanNemeth Apr 7, 2018
17f2712
Change component name
StefanNemeth Apr 7, 2018
71d03f6
Fix flow errors
StefanNemeth Apr 7, 2018
dc35219
Validate draftjs state in addMessage mutation
mxstbr Apr 7, 2018
2bb3b8e
Add skip link to the NavBar
Tom-Bonnike Apr 5, 2018
4a455a3
tested with data. slight media query adjustment.
superbryntendo Apr 7, 2018
8dc14d3
double-checked the member grid. looks good. removed one extraneous div.
superbryntendo Apr 7, 2018
a1f150f
fixes background-color issue on profiles in firefox.
superbryntendo Apr 7, 2018
4fccc01
Display sign in buttons in a grid
Apr 7, 2018
f51adc9
Add docs for banning users
brianlovin Apr 8, 2018
5942a21
Add changefeeds for banned and unbanned users for search indexing
brianlovin Apr 8, 2018
7ae8314
Update deleting users docs
brianlovin Apr 8, 2018
be30517
Adjust scores and spam limits for mods/owners
brianlovin Apr 8, 2018
d99dea5
remove consoles
brianlovin Apr 8, 2018
65b9b98
Possibly fix broken chat input layout
brianlovin Apr 8, 2018
0e3d3c4
Small reorg
brianlovin Apr 8, 2018
585d7e5
Merge pull request #2784 from lachlanjc/service-grid
brianlovin Apr 8, 2018
560ee66
Style inline code in messages and chat input
brianlovin Apr 8, 2018
ed0ed05
Refactor and use theme vars everywhere
brianlovin Apr 8, 2018
39a6fd4
Merge pull request #2779 from withspectrum/md-in-chat-input
brianlovin Apr 8, 2018
cdfb597
Merge pull request #2765 from dev-drprasad/truncate-link-attachments-…
brianlovin Apr 8, 2018
6090db4
Merge pull request #2762 from satyarohith/clone-fix-docs
brianlovin Apr 8, 2018
2af5a05
Fix flow issue with debounce function
LetItRock Apr 8, 2018
c485a96
Add aria-current to NavBar links when the target page is active
Tom-Bonnike Apr 5, 2018
a5d5f54
Filter out invalid props from Link component to avoid warnings in con…
Tom-Bonnike Apr 7, 2018
ebbd159
Merge pull request #2786 from withspectrum/fix-chat-input-layout
mxstbr Apr 8, 2018
ffc1263
Fix broken links in docs ToC
esakkiraj Apr 8, 2018
a28d566
Merge pull request #2787 from esakkiraj/alpha
mxstbr Apr 8, 2018
bdb535b
Add UI for removing image preview
StefanNemeth Apr 8, 2018
7fa2d65
Remove MP4 as an accepted media input
StefanNemeth Apr 8, 2018
bb068d1
Add toobusy handling to worker servers
sivakar12 Apr 8, 2018
5e1f5ec
Merge branch 'issue2741' of git://github.com/sivakar12/spectrum into …
mxstbr Apr 9, 2018
8d0b70a
Make the toobusy middleware work with vanilla httpServer
mxstbr Apr 9, 2018
0ff25d9
Remove current code block handling
mxstbr Apr 9, 2018
91e6de7
Fix exiting code blocks
mxstbr Apr 9, 2018
e3ff345
fix: Better avatar card positioning
Apr 9, 2018
4e0366e
Remove unnecessary code message renderer
mxstbr Apr 9, 2018
d924e88
Fix snapshots for message rendering tests
mxstbr Apr 9, 2018
a9c382e
Flow ignore only the problematic node_modules
Apr 9, 2018
15117de
Fixed absolute imports in Flow config
Apr 9, 2018
093b111
Merge pull request #2791 from FezVrasta/fix/better-avatar-card-positi…
mxstbr Apr 9, 2018
fa1c713
Further refactor circle config
mxstbr Apr 9, 2018
ad3540e
Move setup step
mxstbr Apr 9, 2018
586b041
Merge branch 'alpha' into fix-tests
mxstbr Apr 9, 2018
5d7adf9
Fixed logged-out view
mxstbr Apr 9, 2018
4e07bb0
Fix blocked users returning null
mxstbr Apr 9, 2018
349faf5
Fix a bunch of errors during e2e tests
mxstbr Apr 9, 2018
a2460d7
delete empty spec
mxstbr Apr 9, 2018
862f89b
Increase timeout
mxstbr Apr 9, 2018
6e7e625
Merge and fix conflicts
brianlovin Apr 9, 2018
45f5241
Fix danger warnings
brianlovin Apr 9, 2018
37f532d
Merge pull request #2774 from withspectrum/allow-platform-blocking
brianlovin Apr 9, 2018
7388eea
Merge pull request #2788 from sivakar12/issue2741
brianlovin Apr 9, 2018
28f120d
Trigger ci rebuild
brianlovin Apr 9, 2018
a70412e
Merge pull request #2758 from withspectrum/stop-thread-spam
brianlovin Apr 9, 2018
c357440
Re-add mp4 as an accepted media input
StefanNemeth Apr 9, 2018
1b008b9
Merge pull request #2778 from StefanNemeth/alpha
brianlovin Apr 9, 2018
6b021be
Fix opacity on media preview
brianlovin Apr 9, 2018
93b36be
Merge pull request #2797 from withspectrum/fix-image-preview-opacity
brianlovin Apr 9, 2018
f055a5a
Potential fix
brianlovin Apr 9, 2018
fe74911
Fix thread view auth links
brianlovin Apr 9, 2018
574133d
One more check
brianlovin Apr 9, 2018
6e68567
Merge pull request #2799 from withspectrum/fix-messages-tab
brianlovin Apr 9, 2018
c3dd93c
Merge pull request #2798 from withspectrum/fix-thread-view-auth
brianlovin Apr 9, 2018
615b551
Swap out sentry dsn to secret ones
brianlovin Apr 9, 2018
9075c86
Fixes user profiles in top members component of analytics
brianlovin Apr 10, 2018
2dfdf51
Merge pull request #2709 from withspectrum/restrict-deployments-to-sfo
brianlovin Apr 10, 2018
da82078
Better email failure handling in hermes
brianlovin Apr 10, 2018
aab88f1
Remove console
brianlovin Apr 10, 2018
d7cbc53
addresses brian's feedback. adds documentation for the behavior of gr…
superbryntendo Apr 10, 2018
9b066a1
flow errors
superbryntendo Apr 10, 2018
e9b5d47
Merge pull request #2802 from withspectrum/fix-rep-in-analytics
mxstbr Apr 10, 2018
25428b8
Fix <main> wrapper causing layout issues
Tom-Bonnike Apr 10, 2018
f810914
Merge branch 'alpha' into fix-tests
mxstbr Apr 10, 2018
d6ba676
Fix some more bugs
mxstbr Apr 10, 2018
aa124cc
Further fixes
mxstbr Apr 10, 2018
4e81509
exit process on unhealthy db in test env
mxstbr Apr 10, 2018
d229431
Fix top communities pure
mxstbr Apr 10, 2018
99cb5d8
Update blacklist with routes currently in use
datio Apr 10, 2018
fec38f9
Fix syntax of media input accept string
StefanNemeth Apr 10, 2018
7a80ea4
Set blob to null instead of creating new instance
StefanNemeth Apr 10, 2018
081c76d
Flow fix
StefanNemeth Apr 10, 2018
ce7fb45
Fix mobile cold start
mxstbr Apr 10, 2018
b825774
Merge pull request #2809 from withspectrum/fix-mobile-cold-start
mxstbr Apr 10, 2018
d4fcd39
Swap spectrum api keys in alpha to keep in sync with prod hotfix
brianlovin Apr 10, 2018
908ad60
Merge pull request #2812 from withspectrum/swap-spectrum-api-key
brianlovin Apr 10, 2018
3c9f53f
Fix flow
brianlovin Apr 10, 2018
ea9cbc4
Merge pull request #2808 from StefanNemeth/fix/blob-undefined
brianlovin Apr 10, 2018
d7a86a3
Review fixes
brianlovin Apr 10, 2018
fb385f4
Merge branch 'fix-hermes-failures' of github.com:withspectrum/spectru…
brianlovin Apr 10, 2018
41b1d3f
Merge pull request #2752 from Tom-Bonnike/header-a11y
brianlovin Apr 10, 2018
0199124
Merge pull request #2674 from withspectrum/fix-tests
brianlovin Apr 10, 2018
3020e94
Merge branch 'alpha' into sentry-secrets
brianlovin Apr 11, 2018
3e96f3f
Merge pull request #2801 from withspectrum/sentry-secrets
brianlovin Apr 11, 2018
7511020
Sort and preserve order of participant heads
brianlovin Apr 11, 2018
1f3fca7
Remove one more console error
brianlovin Apr 11, 2018
6fc5ce7
Merge pull request #2806 from withspectrum/fix-hermes-failures
brianlovin Apr 11, 2018
d5bc190
gets rid of extraneous main element and moves it to replace individua…
superbryntendo Apr 11, 2018
3140e6a
fixes firefox's breaking dm layout issues.
superbryntendo Apr 11, 2018
e0a1428
reverts a bunch of changes made when the main was added at the top le…
superbryntendo Apr 11, 2018
d07ef7a
Add flow typings
brianlovin Apr 11, 2018
da717f5
Create UsernameSearch component which holds validation for username; …
LetItRock Apr 11, 2018
00da9a8
Merge pull request #2816 from withspectrum/fix-participant-heads-reor…
mxstbr Apr 11, 2018
9a0ab5c
Clean up flow types
mxstbr Apr 11, 2018
952a39f
Merge pull request #2783 from LetItRock/set-username-validation-fixes
mxstbr Apr 11, 2018
b0e39ae
Update blacklist with routes currently in use
datio Apr 11, 2018
5e38b6d
Merge pull request #2807 from datio/patch-1
mxstbr Apr 11, 2018
3be66d5
Fix token-based auth for mobile apps
mxstbr Apr 11, 2018
0986e5e
Only allow explicit listens to thread updates
mxstbr Apr 11, 2018
62e405e
Merge pull request #2823 from withspectrum/fix-token-auth
mxstbr Apr 11, 2018
6bfd6ce
Use the closeModal handler for Cancel buttons
johnnynotsolucky Apr 11, 2018
095f435
Merge pull request #2824 from johnnynotsolucky/close-modal
mxstbr Apr 11, 2018
9440938
Update draft-js-markdown-plugin
mxstbr Apr 11, 2018
e61be75
Merge pull request #2826 from withspectrum/update-markdown-plugin
brianlovin Apr 11, 2018
16aeed7
Migration and protections against lowercase usernames
brianlovin Apr 11, 2018
9287a8c
Clean up all channel and community slugs as well, consolidate lowerca…
brianlovin Apr 11, 2018
8c1f068
Handle loader mismatches
brianlovin Apr 11, 2018
690199b
fixes navbar positioning on DM and Notifications views
superbryntendo Apr 11, 2018
266f8b2
Merge branch 'grid-conversion' of github.com:withspectrum/spectrum in…
superbryntendo Apr 11, 2018
5257137
Small tweak to migration
brianlovin Apr 11, 2018
0ecf887
fixes a case where the input gets pushed offscreen in DM threads
superbryntendo Apr 11, 2018
bd595c9
managing height against the tab bar is not ideal. v excited to conver…
superbryntendo Apr 11, 2018
873b779
semi-colons are fun
superbryntendo Apr 11, 2018
8eb1a81
Merge pull request #2818 from withspectrum/grid-conversion
brianlovin Apr 11, 2018
85bb8f2
Clean up and refactor user settings view to align with other settings
brianlovin Apr 11, 2018
79f1b3c
Fix annoying redirect on save
brianlovin Apr 11, 2018
06f3a5c
Set up initial mutation
brianlovin Apr 11, 2018
078996a
Implement client side component for deleting account
brianlovin Apr 11, 2018
50963b0
added actions section for handling additional contextual actions.
superbryntendo Apr 12, 2018
a353562
Implement deleting user mutation
brianlovin Apr 12, 2018
b4724cb
forgot to remove a dumb experiment
superbryntendo Apr 12, 2018
b404a88
Styling and frontend cleanup, prevent deleting if is pro
brianlovin Apr 12, 2018
470c689
Debugging deletion while is pro
brianlovin Apr 12, 2018
e2e0cc9
Merge branch 'alpha' into better-code-blocks-in-messages
mxstbr Apr 12, 2018
4da70d6
WIP: Make typing work without breaking anything else
mxstbr Apr 12, 2018
22e0eb2
Convert text message to DraftJS in addMessage mutation
mxstbr Apr 12, 2018
dc468e2
Chat input send plain text if on Android
mxstbr Apr 12, 2018
0b749c1
Fix Android browser detection
mxstbr Apr 12, 2018
6f399b1
Fix styling of fallback plaintext input
mxstbr Apr 12, 2018
13ec879
Move conversion from text to draftjs earlier
mxstbr Apr 12, 2018
40245fa
Merge pull request #2781 from withspectrum/profile-list-visibility
mxstbr Apr 12, 2018
132166b
Restart API in CI if it crashes during Cypress tests
mxstbr Apr 12, 2018
313e373
Make production API be usable for tests
mxstbr Apr 12, 2018
67f4276
Run production API on Circle
mxstbr Apr 12, 2018
ad363f3
Fix circleci config
mxstbr Apr 12, 2018
3dadd10
Use forever to restart API during testing
mxstbr Apr 12, 2018
668e264
Update testing docs
mxstbr Apr 12, 2018
26e4064
Clean up pending and blocked users styling and layout
brianlovin Apr 12, 2018
aec3346
Small consistency fixes
brianlovin Apr 12, 2018
bea2ebb
Comment out failing tests
mxstbr Apr 12, 2018
4057522
Wait for servers to start before running test suite
mxstbr Apr 12, 2018
673eb25
Waiting for RethinkDB doesnt work
mxstbr Apr 12, 2018
c3c1937
Merge pull request #2836 from withspectrum/fix-android-once-and-for-all
mxstbr Apr 12, 2018
eed95f8
Try and move rethinkdb to docker images
mxstbr Apr 12, 2018
cf37ee2
Make the API return something for the root route
mxstbr Apr 12, 2018
c366398
Wait simulataneously
mxstbr Apr 12, 2018
4ddc5fa
Remove console.logs
mxstbr Apr 12, 2018
ce70233
Merge pull request #2839 from withspectrum/wait-for-servers-to-start-…
mxstbr Apr 12, 2018
f156621
Merge branch 'alpha' of github.com:withspectrum/spectrum into fix-mul…
brianlovin Apr 12, 2018
b4284cf
Merge pull request #2840 from withspectrum/fix-multi-actions
brianlovin Apr 12, 2018
3e5ba70
:recycle: Catch queue failed events and report to sentry
dev-drprasad Apr 12, 2018
2b2fa40
Fix the deprecation warning of Draft.js
Ponjimon Apr 12, 2018
ee90596
Merge pull request #2845 from lookapanda/draftentity-deprecation
mxstbr Apr 12, 2018
a366e54
Merge branch 'alpha' of github.com:withspectrum/spectrum into fix-use…
brianlovin Apr 13, 2018
0056495
Implement custom scalar for lowercase strings
brianlovin Apr 13, 2018
fc11117
Swap strings and emails to LowercaseStrings
brianlovin Apr 13, 2018
32f04a7
Merge branch 'alpha' of github.com:withspectrum/spectrum into delete-…
brianlovin Apr 13, 2018
8aba756
Fix pro stripe config, ensure delete logic if pro
brianlovin Apr 13, 2018
2bf2088
Set up FAQ page
brianlovin Apr 13, 2018
368185b
eslint cleanup
brianlovin Apr 13, 2018
a7a9b23
Add integration test for FAQ page
brianlovin Apr 13, 2018
cc4e5e3
Add more fields to be removed on user deletion
brianlovin Apr 13, 2018
8e99fc6
Add 'deleted' name to show in the ui
brianlovin Apr 13, 2018
9f9d7ef
First pass at FAQ content
brianlovin Apr 13, 2018
6d09f81
Disable product navbar on faq page
brianlovin Apr 13, 2018
91b9b78
Update docs
brianlovin Apr 13, 2018
ff07413
Add integration test for deleting users
brianlovin Apr 13, 2018
d4bd2fa
Fix seeding data with default usersSettings
brianlovin Apr 13, 2018
0e84ebd
Fix tests
brianlovin Apr 13, 2018
4c09f25
Add pointer when hovering over message images
mknepprath Apr 13, 2018
bb0dd2e
Fix logging into mobile for new contributors
mxstbr Apr 13, 2018
adda628
Let anybody log into Expo locally
mxstbr Apr 13, 2018
4aafd93
Merge pull request #2849 from withspectrum/add-api-token-secret
mxstbr Apr 13, 2018
a98d84d
Run testing setup script before starting API in test mode
mxstbr Apr 13, 2018
88a855c
Add styling for code blocks
brianlovin Apr 13, 2018
084501e
Fixes login modal grid on desktop
brianlovin Apr 13, 2018
4b2de7a
Merge pull request #2855 from withspectrum/fix-code-blocks
mxstbr Apr 13, 2018
1db8573
Merge pull request #2850 from withspectrum/fix-initial-integration-te…
mxstbr Apr 13, 2018
ba29d8a
Merge pull request #2848 from mknepprath/message-image-cursor
brianlovin Apr 13, 2018
ccf196b
Merge pull request #2856 from withspectrum/fix-login-modal-width
brianlovin Apr 13, 2018
ba9837b
remove linter errors
alejandronanez Apr 13, 2018
0621bce
Merge branch 'catch-queue-failure-events' of git://github.com/dev-drp…
mxstbr Apr 13, 2018
a60374b
Empty commit to force CircleCi rebuild
mxstbr Apr 13, 2018
532f3a1
Merge pull request #2844 from dev-drprasad/catch-queue-failure-events
mxstbr Apr 13, 2018
c0b327d
Merge pull request #2857 from alejandronanez/linter-cleanup
mxstbr Apr 13, 2018
cfb419e
Reserve right to manage communities immediately
brianlovin Apr 14, 2018
e660a80
Fix nits
brianlovin Apr 14, 2018
bbd9f81
Merge pull request #2833 from withspectrum/fix-username-capitalizatio…
brianlovin Apr 14, 2018
54723a7
Fix broken deployment link
tomscholz Apr 14, 2018
5921110
Merge pull request #2860 from tomscholz/patch-1
mxstbr Apr 14, 2018
0c1e96f
Update draft-js-markdown-plugin
mxstbr Apr 15, 2018
747786c
Cleanup
mxstbr Apr 15, 2018
17b7bf1
Cache homescreen icons from the ServiceWorker
mxstbr Apr 15, 2018
384d69a
Maybe fix DM badge not showing up
mxstbr Apr 15, 2018
dc0bc04
Remove console.log
mxstbr Apr 15, 2018
64c98c5
draftjs-editor => rich-text-editor
mxstbr Apr 15, 2018
0ee0316
Create android-friendly wrapper around draft-js-plugins-editor
mxstbr Apr 15, 2018
89253bf
shows a cheat sheet of supported markdown features
spartDev Apr 15, 2018
ff48fc2
Request screenshots in pull request template
brianlovin Apr 15, 2018
741ac80
remove unsuported ~strike~
spartDev Apr 15, 2018
0f8fb98
Merge branch 'alpha' into delete-users
brianlovin Apr 15, 2018
91985e5
fix markdownHint for bold and italics
spartDev Apr 15, 2018
dee8636
remove underscore syntax
spartDev Apr 15, 2018
868236c
Try to fix delete user test, runs locally fine
brianlovin Apr 15, 2018
1ff6143
Merge pull request #2868 from withspectrum/draft-js-fixies
mxstbr Apr 16, 2018
3c6be37
Merge pull request #2866 from withspectrum/maybe-fix-dm-badge
mxstbr Apr 16, 2018
52eba9e
Merge pull request #2865 from withspectrum/cache-icons-in-sw
mxstbr Apr 16, 2018
1d2f602
Merge pull request #2847 from withspectrum/delete-users
mxstbr Apr 16, 2018
f6ba041
Merge branch 'alpha' into update-markdown-plugin-to-v1.4.3
mxstbr Apr 16, 2018
51e42b5
Fix missing file
mxstbr Apr 16, 2018
29391d2
Merge pull request #2863 from withspectrum/update-markdown-plugin-to-…
mxstbr Apr 16, 2018
f81e107
add cypress test
spartDev Apr 16, 2018
a6d3227
Fix integration test
mxstbr Apr 16, 2018
f0015b0
Remove redundant integration test
mxstbr Apr 16, 2018
b7437db
Get rid of toPlainText usage to make things faster
mxstbr Apr 16, 2018
5176eba
Use .hasText instead of .getLength
mxstbr Apr 16, 2018
5f63cc0
Disabeling CI Danger run for forks
ArturKlajnerok Apr 16, 2018
601de14
Merge pull request #2875 from ArturKlajnerok/danger-fork
mxstbr Apr 16, 2018
0b52bc7
Fix fallback Android input in DMs
mxstbr Apr 16, 2018
84bb752
Update README.md
Eric013 Apr 16, 2018
5fa3f32
Styling and eslint
brianlovin Apr 16, 2018
35aea2b
Merge pull request #2879 from Eric013/patch-1
brianlovin Apr 16, 2018
ff79fb9
Merge pull request #2876 from withspectrum/fix-android-fallback-input…
brianlovin Apr 16, 2018
ccad091
Update PULL_REQUEST_TEMPLATE.md
brianlovin Apr 16, 2018
8fe30d2
Merge pull request #2870 from spartDev/markdown-hints
brianlovin Apr 16, 2018
788b90f
Merge pull request #2871 from withspectrum/update-pr-template
mxstbr Apr 16, 2018
7b88425
Merge alpha and fix conflicts
brianlovin Apr 16, 2018
bffba60
Update version
brianlovin Apr 16, 2018
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
20 changes: 10 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,12 @@ aliases:
name: Setup and build
command:
|
node -e "const setup = require('./shared/testing/setup.js')().then(() => process.exit())"
yarn run build:web
yarn run build:api

- &start-api
name: Start the API in the background
command: TEST_DB=true yarn run dev:api
command: yarn run start:api:test
background: true

- &start-web
Expand Down Expand Up @@ -90,28 +89,28 @@ jobs:
- image: circleci/node:8-browsers
- image: redis:3.2.7
- image: cypress/base:6
- image: rethinkdb:2.3.5
environment:
TERM: xterm
steps:
- attach_workspace:
at: ~/spectrum
- run: *install-rethinkdb
- run: *start-rethinkdb
- run: sleep 10
- run: node -e "const setup = require('./shared/testing/setup.js')().then(() => process.exit())"
- run: *setup-and-build-web
- run: *start-api
- run: *start-web
- run: sleep 60
# Wait for the API and webserver to start
- run: ./node_modules/.bin/wait-on http://localhost:3000 http://localhost:3001
- run:
name: Run Unit Tests
command: yarn run test:ci
- run:
name: Run E2E Tests
command: yarn run test:e2e
- run:
name: Danger
when: always
command: yarn run danger ci
command: test -z $DANGER_GITHUB_API_TOKEN && yarn run danger ci || echo "forks are not allowed to run danger"
- run:
name: Run E2E Tests
command: yarn run test:e2e

# Run eslint, flow etc.
test_static_js:
Expand Down Expand Up @@ -170,6 +169,7 @@ workflows:
- test_mobile_js:
requires:
- checkout_environment

# Disabled as Expo is fixing their critical issue with Detox
# - test_mobile_native:
# requires:
Expand Down
16 changes: 14 additions & 2 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
[ignore]
.*/node_modules/.*
.*/build.*
.*/*.test.js
.*/.expo
.*/node_modules/expo
.*/node_modules/react-native
.*/node_modules/cypress
.*/node_modules/draft-js
.*/node_modules/graphql
.*/node_modules/protobufjs-no-cli
.*/node_modules/react-navigation
.*/node_modules/reqwest
.*/node_modules/sentry-expo

.*/node_modules/react-apollo
.*/node_modules/dataloader


[include]

Expand All @@ -13,7 +25,7 @@ suppress_comment=.*\\$FlowFixMe
suppress_comment=.*\\$FlowIssue
esproposal.class_instance_fields=enable
module.system.node.resolve_dirname=node_modules
module.system.node.resolve_dirname=spectrum
module.system.node.resolve_dirname=.
module.file_ext=.ios.js
module.file_ext=.android.js
module.file_ext=.native.js
Expand Down
5 changes: 5 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@ YES
**Release notes for users (delete if codebase-only change)**
-

<!--

If your pull request introduces changes to the user interface on Spectrum, please share before and after screenshots of the changes (gifs or videos are encouraged for interaction changes). Please include screenshots of desktop and mobile viewports to ensure that all responsive cases are reviewed.

-->
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ build
.DS_Store
src/config/FirebaseConfig.js
npm-debug.log
yarn-error.log
rethinkdb_data
debug
now-secrets.json
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ Spectrum has been under full-time development since March, 2017. See [the roadma
- [Running the app locally](#running-the-app-locally)
- [Roadmap](https://github.com/withspectrum/spectrum/projects/19)
- [Technical](docs/)
- [Testing](docs/testing.md)
- [Testing](docs/testing/intro.md)
- [Background Jobs](docs/backend/background-jobs.md)
- [Deployment](docs/backend/deployment.md)
- [Deployment](docs/deployments.md)
- [API](docs/backend/api/)
- [Fragments](docs/backend/api/fragments.md)
- [Pagination](docs/backend/api/pagination.md)
Expand Down Expand Up @@ -151,6 +151,11 @@ The first step to running Spectrum locally is downloading the code by cloning th

```sh
git clone git@github.com:withspectrum/spectrum.git
```
If you get `Permission denied` error using `ssh` refer [here](https://help.github.com/articles/error-permission-denied-publickey/)
or use `https` link as a fallback.
```sh
git clone https://github.com/withspectrum/spectrum.git
```

#### Installation
Expand Down
12 changes: 10 additions & 2 deletions api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
/**
* The entry point for the server, this is where everything starts
*/
console.log('Server starting...');
const compression = require('compression');
const debug = require('debug')('api');
debug('Server starting...');
debug('logging with debug enabled!');
import { createServer } from 'http';
import express from 'express';
Expand Down Expand Up @@ -62,6 +62,14 @@ app.use(
}
);

app.use('/', (req: express$Request, res: express$Response) => {
res.redirect(
process.env.NODE_ENV === 'production' && !process.env.FORCE_DEV
? 'https://spectrum.chat'
: 'http://localhost:3000'
);
});

import type { Loader } from './loaders/types';
export type GraphQLContext = {
user: DBUser,
Expand Down Expand Up @@ -96,7 +104,7 @@ const subscriptionsServer = createSubscriptionsServer(server, '/websocket');
// graphqlPaths: ['/api'],
// });
server.listen(PORT);
console.log(`GraphQL server running at http://localhost:${PORT}/api`);
debug(`GraphQL server running at http://localhost:${PORT}/api`);

process.on('unhandledRejection', async err => {
console.error('Unhandled rejection', err);
Expand Down
27 changes: 27 additions & 0 deletions api/migrations/20180411183454-lowercase-all-the-slugs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
exports.up = async (r, conn) => {
return Promise.all([
r
.table('users')
.update({
username: r.row('username').downcase(),
email: r.row('email').downcase(),
})
.run(conn),
r
.table('communities')
.update({
slug: r.row('slug').downcase(),
})
.run(conn),
r
.table('channels')
.update({
slug: r.row('slug').downcase(),
})
.run(conn),
]);
};

exports.down = function(r, conn) {
return Promise.resolve();
};
3 changes: 2 additions & 1 deletion api/migrations/seed/default/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const defaultDirectMessageThreads = require('./directMessageThreads');
const defaultUsersDirectMessageThreads = require('./usersDirectMessageThreads');
const defaultUsersCommunities = require('./usersCommunities');
const defaultUsersChannels = require('./usersChannels');
const defaultUsersSettings = require('./usersSettings')();
const defaultMessages = require('./messages');

module.exports = {
Expand All @@ -23,8 +24,8 @@ module.exports = {
defaultUsersCommunities,
defaultUsersChannels,
defaultMessages,
defaultUsersSettings,
defaultNotifications: [],
defaultCommunitySettings: [],
defaultChannelSettings: [],
defaultUsersSettings: [],
};
33 changes: 33 additions & 0 deletions api/migrations/seed/default/usersSettings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// @flow

module.exports = () => {
let settings = [];
for (let step = 0; step < 10; step++) {
settings.push({
userId: step.toString(),
notifications: {
types: {
newMessageInThreads: {
email: true,
},
newMention: {
email: true,
},
newDirectMessage: {
email: true,
},
newThreadCreated: {
email: true,
},
dailyDigest: {
email: true,
},
weeklyDigest: {
email: true,
},
},
},
});
}
return settings;
};
9 changes: 9 additions & 0 deletions api/models/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ const config = IS_PROD

var r = require('rethinkdbdash')(config);

// Exit the process on unhealthy db in test env
if (process.env.TEST_DB) {
r.getPoolMaster().on('healthy', healthy => {
if (!healthy) {
process.exit(1);
}
});
}

if (process.env.NODE_ENV === 'development') {
const fs = require('fs');
const inspect = require('rethinkdb-inspector');
Expand Down
27 changes: 14 additions & 13 deletions api/models/thread.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
// @flow
const { db } = require('./db');
import intersection from 'lodash.intersection';
import {
processReputationEventQueue,
sendThreadNotificationQueue,
_adminProcessToxicThreadQueue,
} from 'shared/bull/queues';
import { processReputationEventQueue } from 'shared/bull/queues';
const { NEW_DOCUMENTS, parseRange } = require('./utils');
import { createChangefeed } from 'shared/changefeed-utils';
import { deleteMessagesInThread } from '../models/message';
Expand Down Expand Up @@ -114,6 +110,19 @@ export const getThreadsInTimeframe = (
.run();
};

// We do not filter by deleted threads intentionally to prevent users from spam
// creating/deleting threads
export const getThreadsByUserAsSpamCheck = (
userId: string,
timeframe: number = 60 * 10
): Promise<Array<?DBThread>> => {
return db
.table('threads')
.getAll(userId, { index: 'creatorId' })
.filter(db.row('createdAt').during(db.now().sub(timeframe), db.now()))
.run();
};

/*
When viewing a user profile we have to take two arguments into account:
1. The user who is being viewed
Expand Down Expand Up @@ -313,14 +322,6 @@ export const publishThread = (
.run()
.then(result => {
const thread = result.changes[0].new_val;
sendThreadNotificationQueue.add({ thread });
processReputationEventQueue.add({
userId,
type: 'thread created',
entityId: thread.id,
});
_adminProcessToxicThreadQueue.add({ thread });

return thread;
});
};
Expand Down
42 changes: 28 additions & 14 deletions api/models/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,6 @@ const getUsers = (userIds: Array<string>): Promise<Array<DBUser>> => {
.run();
};

const getUsersBySearchString = (string: string): Promise<Array<DBUser>> => {
return (
db
.table('users')
// get users whose username or displayname matches a case insensitive string
.filter(user => user.coerceTo('string').match(`(?i)${string}`))
// only return the 10 users who match to avoid overloading the dom and sending
// down too much data at once
.limit(10)
.run()
);
};

const storeUser = (user: Object): Promise<DBUser> => {
return db
.table('users')
Expand Down Expand Up @@ -448,6 +435,33 @@ const updateUserEmail = (userId: string, email: string): Promise<Object> => {
.then(() => getUserById(userId));
};

const deleteUser = (userId: string) => {
return db
.table('users')
.get(userId)
.update({
username: null,
email: null,
deletedAt: new Date(),
providerId: null,
fbProviderId: null,
googleProviderId: null,
githubProviderId: null,
githubUsername: null,
profilePhoto: null,
description: null,
website: null,
timezone: null,
lastSeen: null,
modifiedAt: null,
firstName: null,
lastName: null,
pendingEmail: null,
name: 'Deleted',
})
.run();
};

module.exports = {
getUser,
getUserById,
Expand All @@ -456,7 +470,6 @@ module.exports = {
getUsersByUsername,
getUsersThreadCount,
getUsers,
getUsersBySearchString,
getUserByIndex,
saveUserProvider,
createOrFindUser,
Expand All @@ -466,4 +479,5 @@ module.exports = {
setUserOnline,
setUserPendingEmail,
updateUserEmail,
deleteUser,
};
Loading