Add support for MSC4155 #1013

Merged
nex merged 18 commits from ginger/msc4155 into main 2025-09-21 17:03:40 +00:00
Owner
[rendered msc here](https://github.com/Johennes/matrix-spec-proposals/blob/johannes/invite-filtering/proposals/4155-invite-filtering.md). Closes #836.
feat(ci): Initial debian build workflow
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Release Docker Image / define-variables (pull_request) Successful in 8s
Release Docker Image / build-image (linux/arm64, release, linux-arm64, base) (pull_request) Failing after 17s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m2s
Release Docker Image / build-image (linux/amd64, release, linux-amd64, base) (pull_request) Successful in 5m58s
Release Docker Image / merge (pull_request) Has been skipped
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 11m0s
3fc03c9cd7
fix: Remove copied Fedora-specific workflow step
Some checks are pending
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m15s
Release Docker Image / define-variables (pull_request) Successful in 5s
Build / Debian DEB / build (push) Waiting to run
Release Docker Image / build-image (linux/amd64, release, linux-amd64, base) (pull_request) Successful in 7m19s
Release Docker Image / build-image (linux/arm64, release, linux-arm64, base) (pull_request) Successful in 5m20s
Release Docker Image / merge (pull_request) Successful in 3s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 10m37s
5a2288fe06
ginger force-pushed ginger/msc4155 from a5a8dc32bc
Some checks failed
Build / Debian DEB / build (debian-oldstable) (push) Has been cancelled
Build / Debian DEB / build (ubuntu-latest) (push) Has been cancelled
Build / Debian DEB / build (debian-latest) (push) Has been cancelled
Build / Debian DEB / build (ubuntu-previous) (push) Has been cancelled
Documentation / Build and Deploy Documentation (pull_request) Successful in 25s
Release Docker Image / define-variables (pull_request) Successful in 2s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m19s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 1m50s
Release Docker Image / build-image (linux/amd64, release, linux-amd64, base) (pull_request) Failing after 23s
Release Docker Image / build-image (linux/arm64, release, linux-arm64, base) (pull_request) Failing after 22s
Release Docker Image / merge (pull_request) Has been skipped
to 053c18f9b6
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Successful in 32s
Release Docker Image / define-variables (pull_request) Successful in 3s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m0s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 17m44s
Release Docker Image / build-image (linux/amd64, release, linux-amd64, base) (pull_request) Successful in 13m41s
Release Docker Image / build-image (linux/arm64, release, linux-arm64, base) (pull_request) Successful in 14m17s
Release Docker Image / merge (pull_request) Successful in 11s
2025-09-11 12:48:19 +00:00
Compare
ginger force-pushed ginger/msc4155 from 988d3bbcea
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Successful in 33s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 57s
Release Docker Image / define-variables (pull_request) Successful in 4s
Release Docker Image / build-image (linux/amd64, release, linux-amd64, base) (pull_request) Successful in 4m38s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 10m24s
Release Docker Image / build-image (linux/arm64, release, linux-arm64, base) (pull_request) Successful in 4m22s
Release Docker Image / merge (pull_request) Successful in 13s
to 0c97e28ef8
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Successful in 42s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 59s
Release Docker Image / define-variables (pull_request) Successful in 3s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 9m17s
Release Docker Image / build-image (linux/amd64, release, linux-amd64, base) (pull_request) Successful in 4m30s
Release Docker Image / build-image (linux/arm64, release, linux-arm64, base) (pull_request) Successful in 4m36s
Release Docker Image / merge (pull_request) Successful in 7s
2025-09-11 13:28:28 +00:00
Compare
@ -77,0 +80,4 @@
// return an error for blocked invites. ignored invites aren't handled here
// since the recipient's membership should still be changed to `invite`.
// they're filtered out in api::client::message::is_ignored_pdu
if matches!(recipient_filter_level, FilterLevel::Block) {
Author
Owner

this is different from the old behavior where if the recipient had the sender ignored in m.ignored_user_list their membership would never be changed. the spec says "Servers must not send room invites from ignored users to clients" (which is done with the changes to is_ignored_pdu) and also "Servers may optionally decide to reject [invites from ignored users]", so this should be compliant

this is different from the old behavior where if the recipient had the sender ignored in `m.ignored_user_list` their membership would never be changed. the spec says "Servers must not send room invites from ignored users to clients" (which is done with the changes to `is_ignored_pdu`) and also "Servers may **optionally** decide to reject [invites from ignored users]", so this should be compliant
@ -411,2 +430,3 @@
for recipient_user in &invitees {
if let Err(e) =
invite_helper(&services, sender_user, user_id, &room_id, None, body.is_direct)
invite_helper(&services, sender_user, recipient_user, &room_id, None, body.is_direct)
Author
Owner

if this invite_helper call fails (say, because the recipient has us blocked and we get an error from their HS), it only logs a warning and doesn't fail the request. at this point in the creation process we can't exactly return an error but it still feels very bad to not provide any feedback at all here.

if this `invite_helper` call fails (say, because the recipient has us blocked and we get an error from their HS), it only logs a warning and doesn't fail the request. at this point in the creation process we can't exactly return an error but it still feels very bad to not provide any feedback at all here.
Owner

We don't provide feedback if invites fail at all during the room create process anyway, there isn't really a way to without failing the whole request

We don't provide feedback if invites fail at all during the room create process anyway, there isn't really a way to without failing the whole request
Author
Owner

makes sense. I'd argue that's a flaw with the room creation process as specced but opening a MSC to fix it is probably out of the scope of this PR lol

makes sense. I'd argue that's a flaw with the room creation process as specced but opening a MSC to fix it is probably out of the scope of this PR lol
ginger marked this conversation as resolved
ginger changed title from WIP: Add support for MSC4155 to Add support for MSC4155 2025-09-11 14:07:14 +00:00
nex added this to the v0.5.0-rc.8 milestone 2025-09-11 14:08:40 +00:00
ginger force-pushed ginger/msc4155 from 520ca315be
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Successful in 57s
Release Docker Image / define-variables (pull_request) Successful in 2s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m3s
Release Docker Image / build-image (linux/amd64, release, linux-amd64, base) (pull_request) Successful in 7m46s
Release Docker Image / build-image (linux/arm64, release, linux-arm64, base) (pull_request) Successful in 8m2s
Release Docker Image / merge (pull_request) Successful in 10s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 15m6s
to 862bcfa17d
All checks were successful
Release Docker Image / define-variables (pull_request) Successful in 7s
Documentation / Build and Deploy Documentation (pull_request) Successful in 38s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 46s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 7m35s
Release Docker Image / Build linux-arm64 (pull_request) Successful in 8m5s
Release Docker Image / Build linux-amd64 (pull_request) Successful in 8m37s
Release Docker Image / Build linux-amd64-haswell (pull_request) Successful in 23m3s
Release Docker Image / Create Haswell Manifest (pull_request) Successful in 11s
Release Docker Image / Create Multi-arch Manifest (pull_request) Successful in 8s
2025-09-11 16:21:05 +00:00
Compare
nex requested review from nex 2025-09-11 16:56:09 +00:00
@ -295,0 +309,4 @@
&& event
.get_content::<RoomMemberEventContent>()
.is_ok_and(|content| content.membership == MembershipState::Invite)
&& services
Owner

Does this ignore ALL invites from an ignored sender? Or only ones to ourselves?

Does this ignore ALL invites from an ignored sender? Or only ones to ourselves?
Author
Owner

turns out this function doesn't get called with member state events at all! the fixed filtering code does only ignore invites to ourselves

turns out this function doesn't get called with member state events at all! the fixed filtering code does only ignore invites to ourselves
ginger marked this conversation as resolved
Jade left a comment
Owner

Are state events handled properly? Invites from remote users in particular show up in sync under their own room with stripped state events, rather than in the timeline

Are state events handled properly? Invites from remote users in particular show up in sync under their own room with stripped state events, rather than in the timeline
chore: Remove unused imports
Some checks failed
Release Docker Image / define-variables (pull_request) Successful in 8s
Documentation / Build and Deploy Documentation (pull_request) Successful in 24s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 37s
Release Docker Image / Build linux-arm64 (pull_request) Successful in 5m55s
Release Docker Image / Build linux-amd64 (pull_request) Successful in 6m22s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 8m0s
Release Docker Image / Create Multi-arch Manifest (pull_request) Has been skipped
Release Docker Image / Build linux-amd64-haswell (pull_request) Successful in 14m57s
Release Docker Image / Create Haswell Manifest (pull_request) Successful in 9s
f43c4ac3af
chore: Clippy fixes
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Successful in 30s
Release Docker Image / define-variables (pull_request) Successful in 2s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 34s
Release Docker Image / Build linux-amd64 (pull_request) Successful in 5m4s
Release Docker Image / Build linux-arm64 (pull_request) Successful in 4m19s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 9m55s
Release Docker Image / Build linux-amd64-haswell (pull_request) Successful in 16m27s
Release Docker Image / Create Haswell Manifest (pull_request) Successful in 7s
Release Docker Image / Create Multi-arch Manifest (pull_request) Successful in 8s
037ce27fb1
ginger force-pushed ginger/msc4155 from 051564fbaf
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Successful in 39s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 42s
Release Docker Image / Build linux-amd64 (release) (pull_request) Successful in 5m22s
Release Docker Image / Build linux-arm64 (release) (pull_request) Successful in 5m23s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 12m24s
Release Docker Image / Create Multi-arch Release Manifest (pull_request) Successful in 10s
Release Docker Image / Build linux-amd64 (max-perf) (pull_request) Successful in 24m16s
Release Docker Image / Build linux-arm64 (max-perf) (pull_request) Successful in 13m31s
Release Docker Image / Create Max-Perf Manifest (pull_request) Successful in 10s
to faa35e4ffe
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Successful in 41s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m1s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 5m55s
Release Docker Image / Build linux-amd64 (release) (pull_request) Successful in 7m7s
Release Docker Image / Build linux-arm64 (release) (pull_request) Successful in 7m6s
Release Docker Image / Create Multi-arch Release Manifest (pull_request) Successful in 10s
Release Docker Image / Build linux-amd64 (max-perf) (pull_request) Successful in 21m53s
Release Docker Image / Build linux-arm64 (max-perf) (pull_request) Successful in 22m19s
Release Docker Image / Create Max-Perf Manifest (pull_request) Successful in 17s
2025-09-16 12:52:48 +00:00
Compare
nex self-assigned this 2025-09-17 21:09:41 +00:00
chore: Merge remote-tracking branch 'upstream/main' into ginger/msc4155
Some checks failed
Release Docker Image / Build linux-amd64 (max-perf) (pull_request) Blocked by required conditions
Release Docker Image / Build linux-arm64 (max-perf) (pull_request) Blocked by required conditions
Release Docker Image / Create Max-Perf Manifest (pull_request) Blocked by required conditions
Documentation / Build and Deploy Documentation (pull_request) Successful in 23s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 44s
Update flake hashes / update-flake-hashes (pull_request) Failing after 0s
Release Docker Image / Build linux-arm64 (release) (pull_request) Failing after 1h13m30s
Release Docker Image / Build linux-amd64 (release) (pull_request) Failing after 1h13m41s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 1h13m46s
Release Docker Image / Create Multi-arch Release Manifest (pull_request) Has been cancelled
3fe9d96929
fix: Duplicated statement
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Successful in 28s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 54s
Update flake hashes / update-flake-hashes (pull_request) Failing after 1m50s
Release Docker Image / Build linux-amd64 (release) (pull_request) Successful in 6m25s
Release Docker Image / Build linux-arm64 (release) (pull_request) Successful in 6m53s
Release Docker Image / Create Multi-arch Release Manifest (pull_request) Successful in 13s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 9m25s
Release Docker Image / Create Max-Perf Manifest (pull_request) Has been cancelled
Release Docker Image / Build linux-amd64 (max-perf) (pull_request) Has been cancelled
Release Docker Image / Build linux-arm64 (max-perf) (pull_request) Has been cancelled
0ad920a04a
nex approved these changes 2025-09-21 16:58:54 +00:00
nex scheduled this pull request to auto merge when all checks succeed 2025-09-21 16:59:55 +00:00
nex merged commit 13b7538785 into main 2025-09-21 17:03:40 +00:00
nex deleted branch ginger/msc4155 2025-09-21 17:03:40 +00:00
nex referenced this pull request from a commit 2025-09-21 17:03:41 +00:00
Sign in to join this conversation.
No reviewers
nex
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
continuwuation/continuwuity!1013
No description provided.