FriendsOfFlarum / spamblock

Mark user as spammer, suspending them & hiding their posts and discussions
MIT License
9 stars 6 forks source link

nmo #28

Closed thestinger closed 10 months ago

thestinger commented 10 months ago

Bug Report

Current Behavior

Since this set of package updates was applied for our forum, marking users as spammers is no longer suspending them only removing their posts. It still properly marks their posts as deleted. Redoing it doesn't change anything and it's consistently not working rather than just sometimes not working. I don't see any relevant changes in this repository, so I'm confused about why this would be happening.

https://github.com/GrapheneOS/discuss.grapheneos.org/commit/baa636e8925ce8da014b301a2d7e127f49bd74dd

Can anyone else replicate the problem? We're really unable to dedicate time to debugging this right now.

Steps to Reproduce

Mark a non-suspended user as a spammer with the extension.

Expected Behavior

Should suspend the user in addition to deleting posts. Happens with any browser and not caused by browser extensions.

Environment


Flarum core: 1.8.3
PHP version: 8.2.12
MySQL version: 11.1.2-MariaDB
Loaded extensions: Core, date, libxml, openssl, pcre, zlib, ctype, dom, fileinfo, filter, hash, json, mbstring, pcntl, SPL, session, PDO, standard, posix, random, readline, Reflection, Phar, SimpleXML, tokenizer, xml, xmlreader, xmlwriter, mysqlnd, curl, gd, pdo_mysql, zip, Zend OPcache
+----------------------+---------+--------+
| Flarum Extensions    |         |        |
+----------------------+---------+--------+
| ID                   | Version | Commit |
+----------------------+---------+--------+
| flarum-flags         | v1.8.0  |        |
| flarum-suspend       | v1.8.1  |        |
| flarum-tags          | v1.8.0  |        |
| flarum-approval      | v1.8.0  |        |
| fof-user-bio         | 1.3.1   |        |
| fof-sitemap          | 2.2.1   |        |
| fof-nightmode        | 1.5.3   |        |
| fof-filter           | 1.1.3   |        |
| flarum-subscriptions | v1.8.0  |        |
| flarum-sticky        | v1.8.0  |        |
| flarum-statistics    | v1.8.0  |        |
| flarum-mentions      | v1.8.2  |        |
| flarum-markdown      | v1.8.0  |        |
| flarum-lock          | v1.8.0  |        |
| flarum-likes         | v1.8.0  |        |
| flarum-lang-english  | v1.8.0  |        |
+----------------------+---------+--------+
Base URL: https://discuss.grapheneos.org
Installation path: /opt/flarum
Queue driver: sync
Session driver: file
Scheduler status: Active
Mail driver: smtp
Debug mode: off

Additional Context

See https://github.com/GrapheneOS/discuss.grapheneos.org/commit/baa636e8925ce8da014b301a2d7e127f49bd74dd for the set of updates which caused this. May help with figuring out the issue.

clarkwinkelmann commented 10 months ago

@imorland it seems like you inverted the condition to only suspend users who are already suspended in your latest PR https://github.com/FriendsOfFlarum/spamblock/commit/c511a9ee7abc0a7b05833b1609a146defd74b8d2#diff-34455a1050fd3415980d42a79b335982687afc6e2fec6a455d19b603bdeec2e6R79

I doubt this was intentional and is probably the cause of the issue discussed here.

https://github.com/FriendsOfFlarum/spamblock/blob/1fa4d6157fd7772b6d3cedc6d0d52ed88495abf2/src/Controllers/MarkAsSpammerController.php#L79-L85

Should probably be is_null() / === null

imorland commented 10 months ago

Whoops, thank you @clarkwinkelmann, @thestinger - I'll get this fixed ASAP today..

imorland commented 10 months ago

Fixed in 1.1.2