Skip to content

Conversation

@Gnuxie
Copy link
Contributor

@Gnuxie Gnuxie commented May 3, 2022

I don't think this is complete, but this test was extremely difficult to debug before #282 was discovered (and would still be).

@Gnuxie Gnuxie requested a review from Yoric May 3, 2022 11:31
Copy link
Contributor

@Yoric Yoric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clarifying is always good :)

await goodUser.doRequest("POST", `/_matrix/client/r0/rooms/${encodeURIComponent(roomId)}/report/${encodeURIComponent(badEventId)}`);
reportsToFind.push({
let reportsToFind = [
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// Text report, no comment.

});
reportsToFind.push({
},
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// Text report, with a comment.

await goodUser.doRequest("POST", `/_matrix/client/r0/rooms/${encodeURIComponent(roomId)}/report/${encodeURIComponent(badEventId3)}`, "");
reportsToFind.push({
},
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// Report containing embedded html, no comment.

await goodUser.doRequest("POST", `/_matrix/client/r0/rooms/${encodeURIComponent(roomId)}/report/${encodeURIComponent(badEventId4)}`, "");
reportsToFind.push({
},
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// 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({
},
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// 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;
}
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit ;.

null,
report.comment ? { reason: report.comment } : null
);
reportsToFind.push(report);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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????
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand that comment.

if (roomId = this.mjolnir.managementRoomId) {
notices.push(event);
}
if (notices.length === reportsToFind.length) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be more comfortable if we made this a set or a map and removed reports as they arrive.

@H-Shay H-Shay requested a review from a team as a code owner January 21, 2025 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants