Conversation
Yoric
left a comment
There was a problem hiding this comment.
Clarifying is always good :)
| await goodUser.doRequest("POST", `/_matrix/client/r0/rooms/${encodeURIComponent(roomId)}/report/${encodeURIComponent(badEventId)}`); | ||
| reportsToFind.push({ | ||
| let reportsToFind = [ | ||
| { |
| }); | ||
| reportsToFind.push({ | ||
| }, | ||
| { |
There was a problem hiding this comment.
// Text report, with a comment.
| await goodUser.doRequest("POST", `/_matrix/client/r0/rooms/${encodeURIComponent(roomId)}/report/${encodeURIComponent(badEventId3)}`, ""); | ||
| reportsToFind.push({ | ||
| }, | ||
| { |
There was a problem hiding this comment.
// Report containing embedded html, no comment.
| await goodUser.doRequest("POST", `/_matrix/client/r0/rooms/${encodeURIComponent(roomId)}/report/${encodeURIComponent(badEventId4)}`, ""); | ||
| reportsToFind.push({ | ||
| }, | ||
| { |
There was a problem hiding this comment.
// Report containing long that should be truncated by the report manager because it is too long.
| await goodUser.doRequest("POST", `/_matrix/client/r0/rooms/${encodeURIComponent(roomId)}/report/${encodeURIComponent(badEventId5)}`, ""); | ||
| reportsToFind.push({ | ||
| }, | ||
| { |
There was a problem hiding this comment.
// Report containing long that should be truncated by the report manager because it contains too many newlines.
| console.error("Could not send fifth report", e.body || e); | ||
| throw e; | ||
| } | ||
| ] |
| null, | ||
| report.comment ? { reason: report.comment } : null | ||
| ); | ||
| reportsToFind.push(report); |
There was a problem hiding this comment.
Isn't the report already in reportsToFind?
| await new Promise(resolve => setTimeout(resolve, 1000)); | ||
|
|
||
| let mjolnirRooms = new Set(await matrixClient().getJoinedRooms()); | ||
| // but you invited them???? |
There was a problem hiding this comment.
I don't understand that comment.
| if (roomId = this.mjolnir.managementRoomId) { | ||
| notices.push(event); | ||
| } | ||
| if (notices.length === reportsToFind.length) { |
There was a problem hiding this comment.
I'd be more comfortable if we made this a set or a map and removed reports as they arrive.
I don't think this is complete, but this test was extremely difficult to debug before #282 was discovered (and would still be).