matrix-org / matrix-org/complement
`TestRoomDeleteAlias` tests optional behaviour but fails if it is not performed
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 99
- Forks
- 72
- Avg merge
- 4d 1h
- Merged PRs (30d)
- 8
Description
https://github.com/matrix-org/complement/blob/1a2baac5dbf45ead46409793fe625b3c253eb4f6/tests/csapi/apidoc_room_alias_test.go#L277-L308
The test `Can delete canonical alias` *requires* that servers update the `m.room.canonical_alias` event when an associated alias is deleted via `DELETE /_matrix/client/v3/directory/room/{roomAlias}`, but this behaviour is optional, and not even a SHOULD in the spec:
> Note: Servers **may** choose to update the `alt_aliases` for the `m.room.canonical_alias` state event in the room when an alias is removed. Servers which choose to update the canonical alias event are recommended to, in addition to their other relevant permission checks, delete the alias and return a successful response even if the user does not have permission to update the `m.room.canonical_alias event`.
This means the test will fail on any server that does not choose to implement this behaviour. The test should simply pass or at least be skipped if the canonical alias event update does not come down sync.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in tests/csapi/apidoc_room_alias_test.go at the `Can delete canonical alias` test, lines 277-308. Review how the test observes the `m.room.canonical_alias` event through sync after deleting an alias. Done means the test passes or skips when the optional event update is absent, while still checking the update when it is provided.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100