2184 Commits

Author SHA1 Message Date
roschaefer
2f2bf571ed Eliminate database calls for filed and reviewed
I learned map projections and list comprehensions in cypher tonight!
🎉 So much wow!
2019-12-06 01:57:49 +01:00
mattwr18
4d0df181b6
Merge pull request #2432 from Human-Connection/remove-query-for-disable-property-for-reports
Remove disable from reports.disable Query
2019-12-05 21:14:55 +01:00
mattwr18
9fd4ad47dd
Merge pull request #2317 from Human-Connection/2253-fix-scroll-layout-issue
2253 fix scroll layout issue
2019-12-05 21:02:10 +01:00
roschaefer
8f0ce19f09 Implement getDriver() and getNeode() the same way
I want to introduce `neode` and `neo4j-graphql-js` to my students and
saw this.
2019-12-05 21:00:24 +01:00
Robert Schäfer
b7be0f100b
Merge pull request #2424 from Human-Connection/update-test-description
Update test description
2019-12-05 20:55:59 +01:00
mattwr18
1827889582 Refactor notificationsMiddleware/locations
- start refactoring
- locations does not have any automated tests, which makes it more
difficult to refactor and have confidence that functionality will not be
broken
- notificationsMiddleware in progress
2019-12-05 20:42:45 +01:00
mattwr18
55f25b153c Remove disable from models/Report.js
- we are not setting this property, and it's inclusion in this model
with a default false value meant that there were no errors with seeded
data, but with the data returned from the db_manipulation there was.
2019-12-05 20:31:19 +01:00
mattwr18
de64f1dd4a Refactor hashtagsMiddleware updateHashtagsOfPost
- Favor transaction functions for production environment
- Use one transaction instead of two as we can use optional match to
delete potential previous relationships
2019-12-05 13:43:55 +01:00
mattwr18
f2743c992f Use transaction function jwt/decode 2019-12-05 13:18:06 +01:00
mattwr18
5117a97b1c Use readTransaction for non-write transactions 2019-12-05 13:17:26 +01:00
mattwr18
be319615f8 Merge branch 'master' of github.com:Human-Connection/Human-Connection into 2253-fix-scroll-layout-issue 2019-12-05 11:16:16 +01:00
mattwr18
ace7818eac Update test description
- the test clearly tests that the createdAt doesn't change, we changed
the implementation, but didn't change the test description
2019-12-04 19:56:49 +01:00
mattwr18
42540eb909 Remove dead code, code creep 2019-12-04 19:55:48 +01:00
mattwr18
085b59bf4d Merge branch 'master' of github.com:Human-Connection/Human-Connection into 1710-list-and-protocol-moderation 2019-12-04 13:23:06 +01:00
ogerly
6ce797e8ef test review 2019-12-04 11:20:27 +01:00
Robert Schäfer
faefe75fe6
Merge pull request #2335 from Human-Connection/webfinger
fix: Re-enable webfinger feature
2019-12-03 22:49:03 +01:00
roschaefer
a6dd6b4f3a Follow @mattwr18's suggestions 2019-12-03 21:49:17 +01:00
Robert Schäfer
148016e2bf
Update backend/src/activitypub/routes/webfinger.spec.js
Co-Authored-By: mattwr18 <mattwr18@gmail.com>
2019-12-03 21:43:47 +01:00
mattwr18
b3640659bb Add missing unit tests/refactor code
- Refactoring without tests makes it riskier
- Move some tests from resolver to middleware unit tests to live closer
to where the validation happens, remove duplicate tests
- DRY out code
2019-12-03 17:59:59 +01:00
mattwr18
66f1aa8888 Follow @roschaefer PR review suggestions
- Update seed file with more human readable imageAspectRatios
- Remove copy script from Dockerfile to not expose to others. we'll need
to either start a maintenance server, so it has access to both the
backend/public/uploads and cypher-shell, or copy a script to the backend
that creates a csv, which can be copied to the neo4j pod and then loaded
into the cypher.
- Remove unintended changes to deployment/legacy-migration
- Add back image compression to Post images
2019-12-03 15:33:54 +01:00
roschaefer
132c12a7d3 Close neo4j driver sessions
We had this error in our neo4j pod recently:

```
2019-12-02 08:29:42.680+0000 ERROR Unable to schedule bolt session 'bolt-1018230' for execution since there are no available threads to serve it at the moment. You can retry at a later time or consider increasing max thread pool size for bolt connector(s).
2019-12-02 08:29:42.680+0000 ERROR Unable to schedule bolt session 'bolt-1018224' for execution since there are no available threads to serve it at the moment. You can retry at a later time or consider increasing max thread pool size for bolt connector(s).
2019-12-02 08:29:42.681+0000 ERROR Unable to schedule bolt session 'bolt-1018352' for execution since there are no available threads to serve it at the moment. You can retry at a later time or consider increasing max thread pool size for bolt connector(s).
2019-12-02 08:29:42.682+0000 ERROR Unable to schedule bolt session 'bolt-1018243' for execution since there are no available threads to serve it at the moment. You can retry at a later time or consider increasing max thread pool size for bolt connector(s).
```

Apparently the default is 400 threads. So we must have a leak somewhere.
2019-12-02 18:12:11 +01:00
roschaefer
7c6d5b5129 fix: Re-enable webfinger feature
Ok, so here is the plan. Let's give both our cucumber features and your
cypress tests a prominent place to live. That would be the root level
folder of our application. Second, let's revive formerly dead code step
by step.

Ie. move code from the former location `backend/features/` to `features/`
when it is ready. All edge cases should be tested with unit tests in
`backend/`, see my `webfinger.spec.js` as an example.
2019-12-02 17:31:56 +01:00
mattwr18
4ac3f92989 Fix lint 2019-12-02 15:54:51 +01:00
Alina Beck
d97973ab79 request faker images corresponding to set aspect ratios 2019-12-02 16:10:44 +03:00
mattwr18
e4aba5d4df Add test case/Fix message
- Test that the rule is automatically created for new reviews
- Improve English message
2019-12-02 13:56:44 +01:00
mattwr18
c05065f684 Refactor backend
- update script
- use readTxResult for validateReview
- favor more verbose variables
- do not set review.closed as we close the report and the rule at the
moment is set to 'latestReviewUpdatedAtRules' rule, so it's clear the
last review must have been the one that closed the report
2019-12-02 13:38:35 +01:00
ogerly
19d183e13a Merge https://github.com/Human-Connection/Human-Connection into 1746-Blur_explicit_Image_Content 2019-12-02 13:22:42 +01:00
mattwr18
14a689d955 Remove comments 2019-12-02 12:02:15 +01:00
mattwr18
c088c6eac4 Refactor test to avoid unneccessary http request
- Set up/tear down should not needlessly run http requests. These tests
are not designed to test that the report/review process works as
expected. that is the job of their respective unit tests/e2e tests.
2019-11-29 20:48:11 +01:00
mattwr18
7441dbf28c Merge branch 'master' of github.com:Human-Connection/Human-Connection into 1710-list-and-protocol-moderation 2019-11-29 20:43:09 +01:00
mattwr18
bbd80fbc23 Add test cases for review workflow 2019-11-29 19:45:52 +01:00
mattwr18
f5545e3976 Fix middleware/spec 2019-11-29 19:45:34 +01:00
mattwr18
5d63dda6ee Refactor validateReport/Review
- Don't throw error if a report already exists since we use MERGE and
that does not create a new resource if it exists. That is tested at the
neo4j(database) level.
- We also have a test to make in reports.spec.js that no duplicate is
created to ensure we didn't make some error on our part.
- Fix some faulty logic in validateReview
2019-11-29 18:47:41 +01:00
mattwr18
c0d9fe5257 Test validationMiddleware validateReport/Review 2019-11-29 18:43:24 +01:00
mattwr18
b7f0bc7164
Merge pull request #2375 from Human-Connection/keep_dots_in_emails
Don't remove sub-addresses in emails
2019-11-29 14:14:25 +01:00
mattwr18
2e54a43417
Merge pull request #2333 from Human-Connection/remove_obsolete_invitation_code
refactor: Remove obsolete code about invitation codes
2019-11-29 13:45:46 +01:00
ogerly
7f3f81822e blur the image ok. 2019-11-28 20:40:35 +01:00
roschaefer
76414dbec7 Fix lint 2019-11-28 18:07:00 +01:00
mattwr18
9990fe2cb2 Merge branch 'master' of github.com:Human-Connection/Human-Connection into 1710-list-and-protocol-moderation 2019-11-28 16:14:23 +01:00
mattwr18
89daa3356c Return reviews with reports, rename variables
- Instead of just returning the moderator who reviewed, we return the
review as well
2019-11-28 16:10:33 +01:00
roschaefer
973d3f899a Remove dots of gmail addresses
I had a chat with our moderator Daniel. He asks us to remove dots from
gmail accounts. He finds it more consistent and he has no problem to
write a mail to a gmail address without dots. He is OK to save the
email address different from how a user memorizes it.
2019-11-28 14:02:11 +01:00
roschaefer
7146e0a9b2 Fix lint 2019-11-28 13:48:09 +01:00
mattwr18
21be2c08ba Update to return resource instead of to
- more verbose makes it easier to understand
2019-11-28 13:44:00 +01:00
roschaefer
9e2baf25d2 Don't remove dots in emails 2019-11-28 11:22:09 +01:00
Alina Beck
dda9837569 set aspect ratio for seed data to actual ratio of faker images 2019-11-27 21:34:23 +03:00
mattwr18
6865709210
Merge pull request #2334 from Human-Connection/refactor_is_author_permission
refactor: Close session in isAuthor permission
2019-11-27 18:13:48 +01:00
mattwr18
e6fdb70a07 Merge branch 'master' of github.com:Human-Connection/Human-Connection into 1710-list-and-protocol-moderation 2019-11-27 18:09:24 +01:00
mattwr18
6324fd7d26 Merge branch 'master' of github.com:Human-Connection/Human-Connection into 2253-fix-scroll-layout-issue 2019-11-27 18:05:02 +01:00
mattwr18
c6f16497fa Update Post slug to be non-nullable 2019-11-27 17:45:05 +01:00
mattwr18
d18d9228b0 Refactor tests/resolvers
- we were making multiple http requests to report resources in this
test, now we are bypassing these requests by setting the database up to
how we want to test, then testing what we want in isolation.
- also added tests for closing a report
- favor union for returning resource
- simplify review mutation
2019-11-27 17:35:30 +01:00