forked from rDrama/rDrama
1
0
Fork 0
rDrama/files
Snakes 9eab252e5b
Fix reply/mention notifications from muted users.
Consider the case of the current /notifications filter condition:
    WHERE ... NOT ((comments.sentto = 2) AND (users.is_muted))

SELECT 1 WHERE NOT ((null = 2) AND (true)); ⇒ 0 rows
SELECT 1 WHERE NOT ((1 = 2) AND (true)); ⇒ 1 row
SELECT 1 WHERE NOT ((2 = 2) AND (true)); ⇒ 0 rows

We want the first expression, where comments.sentto = null, to evaluate
to false, not to null, so it negates to true. Behavior as written is:

SELECT 1 WHERE NOT ((null = 2) AND (true)); →
SELECT 1 WHERE NOT (null AND true); →
SELECT 1 WHERE NOT null; →
SELECT 1 WHERE null;

Which guarantees a null return set. If we check first for non-nullity:

SELECT 1 WHERE NOT ((null IS NOT null) AND (null = 2) AND (true)); ⇒ 1
SELECT 1 WHERE NOT ((1 IS NOT null) AND (1 = 2) AND (true)); ⇒ 1
SELECT 1 WHERE NOT ((2 IS NOT null) AND (2 = 2) AND (true)); ⇒ 0
2022-11-21 23:08:31 -05:00
..
assets Fix Twitter embeds (caught in find-replace). 2022-11-21 19:02:23 -05:00
classes Fix reply/mention notifications from muted users. 2022-11-21 23:08:31 -05:00
helpers assetcache: include js/vendor dir. 2022-11-21 19:02:39 -05:00
routes Fix reply/mention notifications from muted users. 2022-11-21 23:08:31 -05:00
templates Make comment removal UI consistent desktop/mobile. 2022-11-21 20:22:18 -05:00
tests fix this https://rdrama.org/post/18459/marseycapywalking-megathread-for-bugs-and-suggestions/2847925?context=8#context 2022-10-06 08:26:10 +02:00
__init__.py
__main__.py make login/signup work on local 2022-11-20 18:28:05 -08:00
cli.py