the-draupnir-project / Draupnir

A Matrix moderation bot
https://the-draupnir-project.github.io/draupnir-documentation/
77 stars 14 forks source link

unban subcommand broken on dendrite #257

Open TruncatedDinoSour opened 6 months ago

TruncatedDinoSour commented 6 months ago

heyo

the !draupnir unban command is broken on dendrite, this is the error :

Sat, 17 Feb 2024 21:11:43 GMT [INFO] [Mjolnir] Command being run by @ari:ari.lt: !mjolnir ban fewuihfiwehfiuhewiufh73hf3h278fh782huihwuiehf7rewh7fhw3h
Sat, 17 Feb 2024 21:11:58 GMT [INFO] [Mjolnir] Command being run by @ari:ari.lt: !mjolnir unban fewuihfiwehfiuhewiufh73hf3h278fh782huihwuiehf7rewh7fhw3h
Sat, 17 Feb 2024 21:12:03 GMT [INFO] [Unban] Unbanning users that match glob: /^fewuihfiwehfiuhewiufh73hf3h278fh782huihwuiehf7rewh7fhw3h$/
/mjolnir/models/PolicyList.js:433
                const sender = event.unsigned['redacted_because'] ? event.unsigned['redacted_because']['sender'] : event.sender;
                                             ^

TypeError: Cannot read properties of undefined (reading 'redacted_because')
    at PolicyList.updateListWithState (/mjolnir/models/PolicyList.js:433:46)
    at PolicyList.updateList (/mjolnir/models/PolicyList.js:341:25)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async UpdateBatcher.checkBatch (/mjolnir/models/PolicyList.js:524:9)

Node.js v20.11.0

using the latest docker image

control room version is v9 list room is v10

Gnuxie commented 6 months ago

Context: The problem is we depend on events being annotated with unsigned, plus Draupnir has legacy code de-structuring raw events adhoc. This specific instance could probably be quite easily fixed, but we can't guarantee spec compliance until the release of Draupnir MPS. https://matrix.to/#/!IaWNErZAgQUhGqJXjX:matrix.org/$ZgUYR4mfPpMrj9Xgui4gS2INpFBCrMalfIQoScKxLr4?via=matrix.org&via=envs.net&via=ubuntu.com

TruncatedDinoSour commented 5 months ago

for the record still very much a problem

Gnuxie commented 5 months ago

Hey there, we're aware of this, and that's why the issue is still open :smiley_cat:

Draupnir just went through a major refactor, but we believe this issue specifically should be fixed within the next release. As all of are events are now parsed with reference to the specification. We will be preparing a pre-release soon.