Skip to content

Support for MSC4190: device management for application services#17705

Merged
sandhose merged 10 commits into
developfrom
quenting/msc4190
Dec 4, 2024
Merged

Support for MSC4190: device management for application services#17705
sandhose merged 10 commits into
developfrom
quenting/msc4190

Conversation

@sandhose
Copy link
Copy Markdown
Member

@sandhose sandhose commented Sep 12, 2024

This is an implementation of MSC4190, which allows appservices to manage their user's devices without /login & /logout.

This can be reviewed commit by commit, as each change in behaviour has been implemented in separate commits.

@onestacked
Copy link
Copy Markdown

I've tested this PR with my PR for mautrix/go and it seems to work.

@onestacked
Copy link
Copy Markdown

@sandhose Any progress on this? What is missing for this to be merged?

@sandhose sandhose marked this pull request as ready for review November 26, 2024 16:50
@sandhose sandhose requested a review from a team as a code owner November 26, 2024 16:50
@sandhose
Copy link
Copy Markdown
Member Author

@onestacked I did not really had the time to get back to it before; I've just wrote a bunch of tests & rebased the PR, it should be ready for review now

Copy link
Copy Markdown
Member

@anoadragon453 anoadragon453 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly wording changes, and one question around a test. Overall LGTM!

Comment thread changelog.d/17705.feature Outdated
Comment thread tests/handlers/test_appservice.py Outdated
Comment thread tests/rest/client/test_devices.py Outdated
Comment thread tests/rest/client/test_devices.py Outdated
Comment thread tests/rest/client/test_devices.py Outdated
Comment thread tests/rest/client/test_devices.py

self.assertEqual(channel.code, 200, msg=channel.result)
det_data = {"user_id": user_id, "home_server": self.hs.hostname}
self.assertLessEqual(det_data.items(), channel.json_body.items())
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand this comparison. You're asking for <= on two dict views? Did you mean to wrap each in len(...)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied what the other test was doing, and it looks like Python will somewhat check that the first dict is a subset of the other?

>>> [("foo", "bar")] <= [("foo", "bar")]
True
>>> [("foo", "bar")] <= [("foo", "bar"), ()]
True
>>> [("foo", "bar")] <= [("foo", "ba"), ()]
False
>>> [("foo", "bar"), ("test", True), ("baz", "qux")] <= [("foo", "bar"), ("baz", "qux")]
False
>>> [("foo", "bar"), ("baz", "qux")] <= [("foo", "bar"), ("test", True), ("baz", "qux")]
True

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, that should probably commented as I imagine that's not a widely known behaviour. But alright!

Comment thread synapse/config/appservice.py Outdated
Comment thread tests/rest/client/test_devices.py
@anoadragon453
Copy link
Copy Markdown
Member

Adding X-Release-Blocker as @sandhose would like to get this merged into the next RC.

sandhose and others added 4 commits December 4, 2024 10:59
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
Copy link
Copy Markdown
Member

@anoadragon453 anoadragon453 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, assuming CI passes.

@sandhose sandhose merged commit 23b626f into develop Dec 4, 2024
@sandhose sandhose deleted the quenting/msc4190 branch December 4, 2024 11:04
yingziwu added a commit to yingziwu/synapse that referenced this pull request Dec 20, 2024
This release contains the security fixes from [v1.120.2](https://github.com/element-hq/synapse/releases/tag/v1.120.2).

- Fix release process to not create duplicate releases. ([\#18025](element-hq/synapse#18025))

- Support for [MSC4190](matrix-org/matrix-spec-proposals#4190): device management for Application Services. ([\#17705](element-hq/synapse#17705))
- Update [MSC4186](matrix-org/matrix-spec-proposals#4186) Sliding Sync to include invite, ban, kick, targets when `$LAZY`-loading room members. ([\#17947](element-hq/synapse#17947))
- Use stable `M_USER_LOCKED` error code for locked accounts, as per [Matrix 1.12](https://spec.matrix.org/v1.12/client-server-api/#account-locking). ([\#17965](element-hq/synapse#17965))
- [MSC4076](matrix-org/matrix-spec-proposals#4076): Add `disable_badge_count` to pusher configuration. ([\#17975](element-hq/synapse#17975))

- Fix long-standing bug where read receipts could get overly delayed being sent over federation. ([\#17933](element-hq/synapse#17933))

- Add OIDC example configuration for Forgejo (fork of Gitea). ([\#17872](element-hq/synapse#17872))
- Link to element-docker-demo from contrib/docker*. ([\#17953](element-hq/synapse#17953))

- [MSC4108](matrix-org/matrix-spec-proposals#4108): Add a `Content-Type` header on the `PUT` response to work around a faulty behavior in some caching reverse proxies. ([\#17253](element-hq/synapse#17253))
- Fix incorrect comment in new schema delta. ([\#17936](element-hq/synapse#17936))
- Raise setuptools_rust version cap to 1.10.2. ([\#17944](element-hq/synapse#17944))
- Enable encrypted appservice related experimental features in the complement docker image. ([\#17945](element-hq/synapse#17945))
- Return whether the user is suspended when querying the user account in the Admin API. ([\#17952](element-hq/synapse#17952))
- Fix new scheduled tasks jumping the queue. ([\#17962](element-hq/synapse#17962))
- Bump pyo3 and dependencies to v0.23.2. ([\#17966](element-hq/synapse#17966))
- Update setuptools-rust and fix building abi3 wheels in latest version. ([\#17969](element-hq/synapse#17969))
- Consolidate SSO redirects through `/_matrix/client/v3/login/sso/redirect(/{idpId})`. ([\#17972](element-hq/synapse#17972))
- Fix Docker and Complement config to be able to use `public_baseurl`. ([\#17986](element-hq/synapse#17986))
- Fix building wheels for MacOS which was temporarily disabled in Synapse 1.120.2. ([\#17993](element-hq/synapse#17993))
- Fix release process to not create duplicate releases. ([\#17970](element-hq/synapse#17970), [\#17995](element-hq/synapse#17995))

* Bump bytes from 1.8.0 to 1.9.0. ([\#17982](element-hq/synapse#17982))
* Bump pysaml2 from 7.3.1 to 7.5.0. ([\#17978](element-hq/synapse#17978))
* Bump serde_json from 1.0.132 to 1.0.133. ([\#17939](element-hq/synapse#17939))
* Bump tomli from 2.0.2 to 2.1.0. ([\#17959](element-hq/synapse#17959))
* Bump tomli from 2.1.0 to 2.2.1. ([\#17979](element-hq/synapse#17979))
* Bump tornado from 6.4.1 to 6.4.2. ([\#17955](element-hq/synapse#17955))
sandhose added a commit to element-hq/matrix-bot-sdk that referenced this pull request Jan 23, 2026
See matrix-org/matrix-spec-proposals#4190

Requires element-hq/synapse#17705

And to put in the registration file `io.element.msc4190: true` for it to
work with Synapse and MAS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants