Skip to content

Commit

Permalink
Notify of posts that the user already responded to
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rossjrw committed Nov 10, 2023
1 parent c77046b commit bb29f26
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
8 changes: 0 additions & 8 deletions notifier/database/queries/get_posts_in_subscribed_threads.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit bb29f26

Please sign in to comment.