This differential extracts a common logic that uses thread subscription, user role and mentioning to decide whether to send a notif. Moreover this logic is used in the client-send code.
Details
- Test that chat muting and user mentioning (also for ENS users) works on the keyserver from the notif perspective.
- To test the client, apply patch from D12477 and then:
- Without any changes there should be no notif payloads generated.
- Play around with hardcoding different configurations of thread subscriptions and examine content of generated notifs.
Diff Detail
- Repository
- rCOMM Comm
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
lib/push/utils.js | ||
---|---|---|
168–173 ↗ | (On Diff #41716) | This is too many parameters. Please replace with an object param, and keep this in mind going forward |
lib/push/utils.js | ||
---|---|---|
214–229 ↗ | (On Diff #41949) | This code was copy pasted when it was extracted to lib from the keyserver therefore I would prefer to keep it untouched. |
lib/push/send-utils.js | ||
---|---|---|
80 ↗ | (On Diff #41949) | Actually the only usage of this type looks like this: const pushUserThreadInfos: { [userID: string]: PushUserThreadInfo } = {}; for (const threadID of threadsToMessageIndices.keys()) { so we need mutability here. I think it is better to just drop type declaration and type the variable inline with mutable type. |
Do you think it would make sense to move this into authorization middleware? So you can specify something like
I don't remember exactly what the API for the reports service is, but right now this diff would allow everyone to "authenticate" to the reports service by just not providing credentials (and get the service token by default). This should probably be scoped per (group of) endpoints.