matrix-org / matrix-org/complement

`TestRoomDeleteAlias` tests optional behaviour but fails if it is not performed

Open Beginner friendly
#900 1 comment 0 reactions 0 assignees View on GitHub

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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.