matrix-org / matrix-org/sytest

Banned user tests differ for local and remote

Open
#940 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Perl
Stars
81
Forks
63
Avg merge
1h 47m
Merged PRs (30d)
1

Description

I was looking at https://github.com/matrix-org/dendrite/issues/1331 and found the following.

In the ban test (https://github.com/matrix-org/sytest/blob/develop/tests/30rooms/07ban.pl) the [Remote banned user](https://github.com/matrix-org/sytest/blob/develop/tests/30rooms/07ban.pl#L82-L109) has the following check, which is not present on the [local user](https://github.com/matrix-org/sytest/blob/develop/tests/30rooms/07ban.pl#L19-L33):
```
->then( sub {
repeat_until_true {
matrix_get_room_state( $banned_user, $room_id,
type => "m.room.member",
state_key => $banned_user->user_id,
)->main::check_http_code(
403 => "ok",
200 => "redo",
);
};
})
```

If I read the [spec](https://matrix.org/docs/spec/client_server/r0.6.1#get-matrix-client-r0-rooms-roomid-state-eventtype-statekey) correctly, the `matrix_get_room_state` should not return a 403 (`You aren't a member of the room and weren't previously a member of the room.`: the user was a member before being banned).

I guess those lines should be removed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review tests/30rooms/07ban.pl, comparing the local-user section at lines 19-33 with the remote-user check at lines 82-109. Read the linked Matrix client-server specification and run the ban test to confirm whether the differing state check is valid. Done means the test consistently reflects the specified behavior for both banned-user cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl
Domain
testing-qa
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.