Fix processing of Web Push and streaming notifications
Original issue description: this has been plaguing me for a while. When I mute a thread I still receive notifications for it on my apps (e.g., Mona on iOS).
Identified problem: federated activities generate notifications without any filters and send them (SideEffects.handle_after_transaction
)
Updated status:
-
Notification.send/1
now exists - Notifications are no longer sent as soon as they are generated (unless passed the flag
do_send: false
; this functionality has been removed) - Federated and local activities which come through the common pipeline always accumulate the notifications for sending at the end of the pipeline (
SideEffects.handle_after_transaction
) - local Create activities do not go through the pipeline yet, but
CommonAPI.post
->...
->ActivityPub.notify_and_stream
now collects the notifications and sends them withNotification.send/1
- We no longer generate activities from users/threads that are blocked/muted. They were previously generated but not sent. This wastes database space for content you didn't want in the first place.
There are a couple test failures but I believe the tests are wrong
Edited by feld