40 Commits

Author SHA1 Message Date
Moriz Wahl
28952567b0 feat(backend): notifications for groups 2023-03-15 15:27:22 +01:00
Wolfgang Huß
5cd1b95907 Fix templates 'variables' argument 2022-06-23 15:51:36 +02:00
Wolfgang Huß
ce5161f937 Test e-mail templates, remain files, first step 2021-11-18 08:53:31 +01:00
Wolfgang Huß
a836872471 Cleanup 2021-09-27 12:36:58 +02:00
Wolfgang Huß
7ae5593f82 Implement user notifications settings 2021-09-22 14:05:10 +02:00
Wolfgang Huß
5e56473b0e Add note 2021-08-12 07:27:12 +02:00
Wolfgang Huß
f3bf730a12 Refine translated e-mail templates 2021-08-11 14:46:59 +02:00
Wolfgang Huß
7e72a0bf03 Implement sending of first translated templates 2021-08-11 10:29:19 +02:00
Wolfgang Huß
0c8287ab03 Delete test Cypher statement 2021-08-11 07:50:29 +02:00
Wolfgang Huß
5fe07c1133 Implement e-mail notification, first step 2021-08-10 16:13:51 +02:00
Wolfgang Huß
f20643af3b Investigate the graph-ql middleware 2021-08-10 10:56:12 +02:00
roschaefer
276ea79e8f Update prettier to v2 2020-03-24 21:11:11 +01:00
mattwr18
a346632fff Avoid running cypher statement if not needed
- it just feels safer to not run a cypher statement if there is no user
  in the idsOfUsers array. Why risk notifications pointing to empty
nodes? It doesn't seem like this happens, but I'm not sure how to write
a test to verify, and why run cypher statements, if there is no need to?
2020-02-18 23:19:14 +01:00
mattwr18
54caaaaa0a Remove unnecessary guard clause
- filter returns an empty array, and no notification is created if
  idsOfUsers is an empty array
2020-02-18 22:43:19 +01:00
mattwr18
7fe6fb110b Remove unnecessary negation of negation, refactor
- tests to use `toMatchObject`, which checks that only one notification
  is indeed created
2020-02-18 22:21:49 +01:00
roschaefer
f32bfc7e36 fix(subscriptions): Don't publish undefined
Fix #3088
2020-02-18 16:25:11 +01:00
mattwr18
6271b53b30 Set up Subscriptions with RedisPubSub 2020-02-07 14:48:55 +01:00
mattwr18
7ac973f9a1 Refactor cypher statement to simplify
- it's questionable whether this simplifies it or not, and actually adds
  one line of code, but now it looks more similiar to the code in the
notifications query
2020-02-05 20:45:56 +01:00
mattwr18
1c6a5503db Get subscriptions working with notifyUserOfComment
- Co-Authored-By: Tirokk <wolle.huss@pjannto.com>
2020-02-05 19:06:55 +01:00
mattwr18
110165691a Refactor out transformReturnType function
- we have introduced a better way to return all the info we want without
  needing to make multiple database queries. It was introduced by
@roschaefer in the PR for the notifications query, but we hadn't
refactored markAsRead yet.
- Now that we are subscribing to notifications, we need to have the same
  return info as the notification query.

- Co-authored-by: Tirokk <wolle.huss@pjannto.com>
2020-02-05 18:42:31 +01:00
mattwr18
2f43069ea0 Subscribe to notifications/remove polling
- We want to publish when a notification occurs for a specific user, not
  have the client poll the backend for ever user every minute.

- Co-authored-by: @Tirokk <wolle.huss@pjannto.com>
2020-02-05 17:37:38 +01:00
mattwr18
04f0467d2d Merge branch 'master' of github.com:Human-Connection/Human-Connection into 1703-add-vue-apollo-subsriptions 2020-02-05 14:33:57 +01:00
mattwr18
a28eb8c91f Start subscriptions for notifications 2020-01-24 18:23:59 +01:00
mattwr18
bbb4dd56cd Follow review suggestions/add button to unblock
- @roschaefer gave several suggestions
- we have a button to unblock/unmute users on profile page
2020-01-23 19:18:12 +01:00
mattwr18
0e757cf94f Refactor to fix test, DRY out code 2019-12-06 17:48:14 +01:00
mattwr18
da150e0b27 Refactor notificationsMiddleware
- Use transaction functions
- extract validations into validationsMiddleware
- break notifyUsers into notifyUsersOfMention/notifyUsersOfComment
2019-12-06 14:48:32 +01:00
mattwr18
132951c525 Update handleContentDataOfPost to return post
- fix tests, functionality
2019-12-06 13:03:05 +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
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
cbc547a86b refactor: small refactoring for readability
@KapilJ your solution is right now the best solution, I think. Probably
the ideal solution would be if we could implement the `CreateComment`
resolver in such a way that it is doing eager loading of the
`comment->post->author` relationship and resolving a commment object
which has the required objects all set. Then you wouldn't have to
refetch all the stuff.

But I think this is OK for now 👍
2019-10-31 16:11:05 +01:00
Kapil Jain
aecc21890e fixed removing original post's user 2019-10-29 14:20:51 -04:00
Kapil Jain
529a8a6365 send only one notification for mention and comment 2019-10-28 15:40:29 -04:00
mattwr18
16d7e6c91a Update notifications
- create only one relationship by using merge, but do not update
createdAt attribute/update test
- order by updatedAt_desc
2019-09-13 20:14:47 +02:00
mattwr18
67d68db231 Update post resolver to fix embarrasing bugs
- when a user updates a post, we should not override every property in
our database with the new params, since we have read-only properties
like createdAt that we don't want to go deleting aimlessly.
2019-09-13 20:14:47 +02:00
mattwr18
ce487f1e0f Set notifications.createdAt only at creation
- we should not be setting it every time a notification is created
2019-09-13 20:14:47 +02:00
roschaefer
2a3e6ad76f Alternative solution for #1494 2019-09-13 20:14:47 +02:00
roschaefer
cbcba8f08d Follow @Tirokk's suggestion 2019-08-30 16:00:32 +02:00
roschaefer
c29ee5e3d3 Update notifications in place 2019-08-30 16:00:32 +02:00
roschaefer
643d175ef6 Implement notifications resolver 2019-08-30 16:00:32 +02:00
Wolfgang Huß
af968461b6 Split handleNotificationsMiddleware in notificationsMiddleware and hashtagsMiddleware 2019-08-26 16:24:43 +02:00