matrix-org / mjolnir

A moderation tool for Matrix
Apache License 2.0
310 stars 54 forks source link

Automatic ban from a protection has over-eager redactions #180

Open grahamc opened 2 years ago

grahamc commented 2 years ago

Describe the bug

Redactions of banned users take place even after the user is unbanned.

To Reproduce Steps to reproduce the behavior:

  1. Use the FirstMessageIsImageProtection protection.
  2. A well known user joins a room for the first time.
  3. They post an image as their first message.
  4. They're banned.
  5. Their post is redacted.
  6. The user did not deserve the ban, so they're unbanned.
  7. They join the room again.
  8. They post a message.
  9. Mjolnir redacts their messages.

Expected behavior I expect Mjolnir to stop redacting a user's messages after they're unbanned.

Screenshots

The "L" and "P" messages deleted near the end are by Mjolnir, after I unbanned both L and P users.

image

Desktop (please complete the following information): I don't think this is related, but I'm on NixOS 21.11 and:

Element version: 1.9.4 Olm version: 3.2.3

Additional context Mjolnir 1.2.1

Twi1ightSparkle commented 2 years ago

Saw this yesterday with a customer Mjolnir. v1.3.1. Mjolnir stopped redacting the affected user after a restart. There are nothing in the logs when this happens. Message me for unredacted logs or access to the relevant moderation room.

Screen_Shot_2022-02-15_at_5_39_10_PM

The user was still being redacted 30 minutes after the "is no longer considered suspect" log entry.

Manually unbannign the user doesn't work as it's not on a ban list.

Screen_Shot_2022-02-15_at_5_43_53_PM