FriendsOfFlarum/spamblock

nmo

Closed this issue · 3 comments

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.

GrapheneOS/discuss.grapheneos.org@baa636e

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 GrapheneOS/discuss.grapheneos.org@baa636e for the set of updates which caused this. May help with figuring out the issue.

@imorland it seems like you inverted the condition to only suspend users who are already suspended in your latest PR c511a9e#diff-34455a1050fd3415980d42a79b335982687afc6e2fec6a455d19b603bdeec2e6R79

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

if ($this->extensions->isEnabled('flarum-suspend') && $user->suspended_until !== null) {
$this->bus->dispatch(
new EditUser($user->id, $actor, [
'attributes' => ['suspendedUntil' => Carbon::now()->addYears(20)],
])
);
}

Should probably be is_null() / === null

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

Fixed in 1.1.2