From bb29f269995525cbf78939350719331db4bdbbef Mon Sep 17 00:00:00 2001 From: Ross Williams Date: Sun, 1 Oct 2023 20:12:48 +0100 Subject: [PATCH] Notify of posts that the user already responded to I've decided that this is a pointless behaviour - personally I'd much rather want the guarantee that I'm going to be notified of a post. Otherwise a vigilant user might fear that the notifications system doesn't actually work. There may well be users who depend on this behaviour and I'm sure they'll pipe up. If in the future I choose to reimplement this behaviour, I should run a migration to remove posts that are no longer relevant because of it. --- .../database/queries/get_posts_in_subscribed_threads.sql | 8 -------- .../database/queries/get_replies_to_subscribed_posts.sql | 9 +-------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/notifier/database/queries/get_posts_in_subscribed_threads.sql b/notifier/database/queries/get_posts_in_subscribed_threads.sql index f18dd754..9379afc7 100644 --- a/notifier/database/queries/get_posts_in_subscribed_threads.sql +++ b/notifier/database/queries/get_posts_in_subscribed_threads.sql @@ -31,11 +31,6 @@ FROM AND thread_sub.thread_id = thread.id AND thread_sub.post_id IS NULL ) - LEFT JOIN - post AS user_response_child_post ON ( - user_response_child_post.parent_post_id = post.id - AND user_response_child_post.user_id = %(user_id)s - ) WHERE -- Remove deleted posts post.is_deleted = 0 @@ -59,9 +54,6 @@ WHERE -- Remove posts in threads unsubscribed from AND (thread_sub.sub <> -1 OR thread_sub.sub IS NULL) - - -- Remove posts the user already responded to - AND user_response_child_post.id IS NULL ORDER BY wiki.id, category.id, diff --git a/notifier/database/queries/get_replies_to_subscribed_posts.sql b/notifier/database/queries/get_replies_to_subscribed_posts.sql index f33eed20..21e0eb1a 100644 --- a/notifier/database/queries/get_replies_to_subscribed_posts.sql +++ b/notifier/database/queries/get_replies_to_subscribed_posts.sql @@ -33,11 +33,6 @@ FROM AND post_sub.thread_id = thread.id AND post_sub.post_id = parent_post.id ) - LEFT JOIN - post AS user_response_child_post ON ( - user_response_child_post.parent_post_id = post.id - AND user_response_child_post.user_id = %(user_id)s - ) WHERE -- Remove deleted posts post.is_deleted = 0 @@ -60,10 +55,8 @@ WHERE ) -- Remove replies to posts unsubscribed from + -- Sub table is added to this query via left join, so the null check matches when the user has no manual subscription to or from a post AND (post_sub.sub <> -1 OR post_sub.sub IS NULL) - - -- Remove posts the user already responded to - AND user_response_child_post.id IS NULL ORDER BY wiki.id, category.id,