fix(alias): preserve room alias enumeration on delete #1567
No reviewers
Labels
No labels
Blocked
Bug
Changelog
Added
Changelog
Missing
Changelog
None
Cherry-picking
Database
Dependencies
Dependencies/Renovate
Difficulty
Easy
Difficulty
Hard
Difficulty
Medium
Documentation
Enhancement
Good first issue
Help wanted
Inherited
Matrix/Administration
Matrix/Appservices
Matrix/Auth
Matrix/Client
Matrix/Core
Matrix/E2EE
Matrix/Federation
Matrix/Hydra
Matrix/MSC
Matrix/Media
Matrix/T&S
Merge
Merge/Manual
Merge/Squash
Meta
Meta/CI
Meta/Packaging
Priority
Blocking
Priority
High
Priority
Low
Security
Status
Confirmed
Status
Duplicate
Status
Invalid
Status
Needs Investigation
Support
Wont fix
old/ci/cd
old/rust
No milestone
No project
No assignees
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
continuwuation/continuwuity!1567
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "0xnim/continuwuity:fix/alias-enumeration-delete"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This pull request fixes a bug in room alias deletion where removing one alias could remove all
aliasid_aliasenumeration entries for that room.remove_alias()previously deleted the fullaliasid_aliasprefix for the resolved room. That left the primary alias mappings (alias_roomid/alias_userid) partially intact, but causedlocal_aliases_for_room()and any callers that depend on alias enumeration to lose unrelated aliases for the same room.This change updates alias removal to scan the room-scoped
aliasid_aliasentries, collect only the keys whose stored value matches the alias being deleted, and remove only those entries. It also removes all matching entries for that alias, which makes the cleanup resilient to duplicate stale index rows.and made new tests:
This should make alias deletion behave consistently for alias listing, alias resolution, and flows that iterate room aliases such as moderation or room cleanup.
Pull request checklist:
mainbranch, and the branch is named something other thanmain.@ -0,0 +117,4 @@globals: Arc<globals::Service>,}impl TestEnv {This seems to be at least the start of a testing environment. Yay! However, it should probably be higher up in the module hierarchy so it can be reused in more places
should i remove them from this pr?
Nah, it can be moved later
f842fd37e33867472948386747294827acc366beThis is good to merge once the Clippy failures are resolved
27acc366be805f4e1a59805f4e1a5902bcdf442bhave a fourth approval
02bcdf442bf17ae4a646f17ae4a6468e7846c644boom
done
shipit