Commit Graph
25939 Commits
Author SHA1 Message Date
Jason Robinson 28563f0921 Make ProfileUpdateAction docstrings more descriptive on what the different enum values mean. 2026-07-01 18:17:09 +03:00
Jason Robinson 6730ad0610 Add str to ProfileUpdateAction types 2026-07-01 17:35:08 +03:00
Jason Robinson 45e9a018af Don't unpact ProfileUpdateAction unnecessarily early 2026-07-01 17:32:08 +03:00
6a5adb9c04 Remove extra ids definition
Co-authored-by: Olivier 'reivilibre' <oliverw@element.io>
2026-07-01 17:23:22 +03:00
ecd890a7af Fix MSC4429 referring comment
Co-authored-by: Olivier 'reivilibre' <oliverw@element.io>
2026-07-01 16:01:40 +03:00
Jason Robinson e6aec556ab Merge remote-tracking branch 'origin/develop' into anoa/msc4429 2026-07-01 11:55:57 +03:00
Jason Robinson eb5aa2129a Ensure both initial and incremental syncs include our own profile and updates
Otherwise if the user has multiple clients doing incremental sync, they wont get their own profile updates to their other clients. For initial because it should probably match the incremental behaviour + it avoids clients needing to look up the profile separately potentially.
2026-07-01 11:22:57 +03:00
aa97687305 Change MSC3814 dehydrated device /events endpoint from POST to GET (#19896)
Change `/org.matrix.msc3814.v1/dehydrated_device/[device_id]/events` to
accept GET requests instead of POST.

The original version of
[MSC3814](https://github.com/matrix-org/matrix-spec-proposals/pull/3814)
said we should delete keys after returning them from this endpoint, but
it is being updated to say we should not delete them, and therefore the
appropriate verb is GET.

Synapse already doesn't delete anything, so we just need to change to a
GET with a `next_batch` query param. (Currently it is a POST with
`next_batch` in the JSON content.)

This code was initially written by @ara4n and Claude, but both he and I
have read it and think it makes sense. I am far from a Synapse expert,
so feel free to tell me it's all wrong and point me in the right
direction.

I don't know what system tests will be affected by this, but I guess we
will see when the CI runs (right?).

This is a change to an unstable endpoint so no need for notifications
about breaking changes or similar.

Part of https://github.com/element-hq/element-meta/issues/2704

### Pull Request Checklist

* [x] Pull request is based on the develop branch
* [x] Pull request includes a [changelog
file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog).
The entry should:
* [x] [Code
style](https://element-hq.github.io/synapse/latest/code_style.html) is
correct (run the
[linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))

---------

Co-authored-by: Matthew Hodgson <matthew@matrix.org>
2026-06-30 21:20:26 +00:00
Olivier 'reivilibre fd8f0e53a3 Tweak changelog v1.156.0rc1 2026-06-30 16:42:21 +01:00
Olivier 'reivilibre a247001400 1.156.0rc1 2026-06-30 14:41:26 +01:00
aa6e616470 Don't delete the dehydrated device when MAS syncs the device list (#19892)
`_synapse/mas/sync_devices` checks the device list against the set of
devices MAS knows about, but the dehydrated device (MSC3814) is
invisible to MAS, so it gets automatically deleted on each sync, which
prevents dehydrated devices from working.

This change excludes the dehydrated device from the check.

There is similar special case code in the admin devices API (which gives
it a special flag) and MAS's own legacy sync path (which filters it
out).

This code was initially written by @ara4n and Claude, but both he and I
have read it and think it makes sense. I am far from a Synapse expert,
so feel free to tell me it's all wrong and point me in the right
direction.

A system-level test for this bug is being written here:
https://github.com/element-hq/element-web/issues/34034 but if you think
we should have one somewhere else, please let me know.

Closes https://github.com/element-hq/synapse/issues/19889

### Pull Request Checklist

* [x] Pull request is based on the develop branch
* [x] Pull request includes a [changelog
file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog).
The entry should:
* [x] [Code
style](https://element-hq.github.io/synapse/latest/code_style.html) is
correct (run the
[linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))

Co-authored-by: Matthew <matthew@element.io>
2026-06-30 15:24:42 +02:00
Andrew MorganandGitHub 1639c30281 Fix the cargo-test and cargo-bench CI jobs not running (#19883) 2026-06-30 11:46:47 +00:00
Jason Robinson a460c285a7 Merge remote-tracking branch 'origin/develop' into anoa/msc4429 2026-06-29 21:58:15 +03:00
Jason Robinson 5064349eec Don't delete custom profile field when setting an empty string 2026-06-29 21:56:58 +03:00
Jason Robinson 496728df15 Add docstrings to tests
Plus make a few tests actually do something sane..
2026-06-29 21:48:11 +03:00
Jason Robinson 2377165ebd Add test to prove initial sync doesn't include users updates who don't share a room 2026-06-29 16:33:36 +03:00
5edcb0f542 MSC4143: Advertise org.matrix.msc4143 in /versions unstable_features (#19646)
Closes #19580

---------

Co-authored-by: toonbr1me <toonbr1me@users.noreply.github.com>
2026-06-29 14:07:43 +01:00
Jason Robinson 60ed1758dc When user has left all rooms shared with a user, clear any previous profile updates
This ensures we don't accidentally leak any profile updates to users no longer sharing rooms.
2026-06-29 16:00:00 +03:00
Jason Robinson bf3e1339ff Fix SCHEMA_VERSION in __init__.py 2026-06-29 13:01:03 +03:00
Jason Robinson b0950f98df Merge remote-tracking branch 'origin/develop' into anoa/msc4429 2026-06-29 12:57:21 +03:00
Jason Robinson 1fc8d4c6cd Move profile updates SQL to latest delta
We shouldn't need a delta bump for this feature as far as I can tell.
2026-06-29 12:39:46 +03:00
Jason Robinson c12623e769 Lint server config 2026-06-26 18:15:30 +03:00
Jason Robinson 088f23065a Gate more things behind msc4429 being enabled 2026-06-26 18:10:25 +03:00
Jason Robinson 4a874c4687 Remove invalid docs on profile_updates stream
`PUT` and `DELETE` can go to any supported worker, replication will handle the stream updates to the right worker.
2026-06-26 18:09:02 +03:00
Jason Robinson b459512725 Use include_profile_updates_in_sync config item instead of an experimental flag + alias.
The requirement for this comes from a customer commitment.
2026-06-26 18:08:12 +03:00
Jason Robinson b2246de4e3 Ensure we don't call _dispatch_record_profile_updates with an empty list of fields 2026-06-26 16:57:33 +03:00
Jason Robinson f453e03c8c Remove more useless casts 2026-06-26 13:29:48 +03:00
Jason Robinson 7a60657dd1 Clean up recording profile updates on changes
Instead of using replication when setting field values, remove that replication, keep writing the field via the profile handler in the current instance, and then dispatch recording the profile update over replication, if needed.

This is cleaner as it ensures we don't need to wrap various places outside the profile handler that set things like the displayname in the "if profile worker else replication" logic.
2026-06-26 13:25:53 +03:00
timedoutandGitHub 7bc2b93e4c Implement unstable support for MSC4491 (#19874)
Signed-off-by: timedout <git@nexy7574.co.uk>
2026-06-26 08:35:26 +00:00
Jason Robinson 8bace9f97b Fix some types in various places regarding profile field values
I believe the correct type is `JsonValue | dict[str, JsonValue]`, except deep down in the displayname/avatar_url store methods.

Removes a dubious cast by correctly casting in `get_profile_data_for_users`
2026-06-25 22:40:00 +03:00
Jason Robinson e278dfdb03 Restore initial sync behaviour to return full profiles of users currently sharing rooms 2026-06-25 21:43:49 +03:00
Jason Robinson 585590bbd9 Protect against stream being rewound 2026-06-25 21:31:07 +03:00
Will HuntandGitHub 2bb3aac839 Add metric to count number of non-deactivated users. (#19848)
This reports the total count of users (split by appservice) which is
meant to be the monthless counterpart to the MAU metric.

Context:

> So this is largely for billing purposes and wanting to know the change
in the number of users. If a user is deactivated then we no longer want
to count them. Consumers *might* want to count appservice users, and
maybe count them based on the service (perhaps you change more for users
under bridge X or bridge Y).
>
> *-- https://github.com/element-hq/synapse/pull/19848#discussion_r3402216234*
2026-06-25 11:57:36 -05:00
Jason Robinson bf10187a1d Docstring for ProfileUpdateAction 2026-06-25 18:35:40 +03:00
Jason Robinson 5f761ab5b4 Use set for uniqueness 2026-06-25 17:39:42 +03:00
Jason Robinson 3e4301ad01 Remove unnecessary if 2026-06-25 15:26:43 +03:00
dependabot[bot]andGitHub 4e9f7757f1 Bump msgpack from 1.1.2 to 1.2.1 (#19873)
Signed-off-by: dependabot[bot] <support@github.com>
2026-06-24 21:16:03 +00:00
dependabot[bot]andGitHub c386ab8f85 Bump bleach from 6.3.0 to 6.4.0 (#19864)
Signed-off-by: dependabot[bot] <support@github.com>
2026-06-24 20:14:47 +00:00
dependabot[bot]andGitHub d304743057 Bump pyjwt from 2.12.0 to 2.13.0 (#19861)
Signed-off-by: dependabot[bot] <support@github.com>
2026-06-24 20:12:15 +00:00
dependabot[bot]andGitHub 732de34bc4 Bump tornado from 6.5.5 to 6.5.7 (#19860)
Signed-off-by: dependabot[bot] <support@github.com>
2026-06-24 20:11:42 +00:00
dependabot[bot]andGitHub 98d28b8ac7 Bump python-multipart from 0.0.27 to 0.0.31 (#19859)
Signed-off-by: dependabot[bot] <support@github.com>
2026-06-24 19:00:24 +00:00
Jason Robinson ea12b22164 Merge remote-tracking branch 'origin/develop' into anoa/msc4429 2026-06-24 19:23:12 +03:00
Jason Robinson b657d2f8db Add a prune job for the profile updates stream tables
Taken and adapted from https://github.com/element-hq/synapse/pull/19473

Didn't add the "safety" table due to afaik that has more relevance with the device updates, and not so much here for the profile updates.
2026-06-24 19:11:41 +03:00
Jason Robinson 05634f90b4 Ensure room_member handler writes profile updates to the right profile update stream writer 2026-06-24 16:29:32 +03:00
Andrew MorganandGitHub 287195db06 Bump poetry in the Dockerfile and when building the debian venv (#19877) 2026-06-24 12:46:44 +00:00
dependabot[bot]andGitHub 5248ea0bc2 Bump the minor-and-patches group across 1 directory with 6 updates (#19863)
Signed-off-by: dependabot[bot] <support@github.com>
2026-06-24 11:38:22 +00:00
Jason Robinson 7c728ec61c Optimize profile handler user_joined_room and user_left_room
Save a db query if there are no users to add profile updates for.
2026-06-24 13:45:13 +03:00
Jason Robinson d3aacee235 Fix test_update_profile_set_field_writes_to_per_user_profile_tracking_table test
And remove unused `get_profile_updates_per_user_for_user` function
2026-06-24 13:32:19 +03:00
Jason Robinson 9d58d19934 Merge remote-tracking branch 'origin/develop' into anoa/msc4429 2026-06-24 11:52:58 +03:00
Olivier 'reivilibreandGitHub 1c79397d7f Tweak wording of Rust crate dependency update policy. (#19829)
After looking into it, just a couple of things to pick a bone at in the
old wording,
which I thought could be clarified for when I next come to look at this
again.


- the claim that there's a fundamental difference; I'd argue there isn't
really, it's just by convention
  on some mainstream distros. So I have changed this to 'typically'
- statements that some distros fetch dependencies at build time
(probably does happen, but
traditional distros make a point of not doing this for the reasons you'd
expect).
- This was probably meant to be talking about Debian, but my observation
based on sample size of 3 is that some crates are packaged natively,
others are vendored in the respective application's source package (like
they do for us) and sometime they patch the bounds a bit

There could probably be room to talk about how distros vendoring
packages is a maintenance burden on them,
but I guess it's a bit moot as we would struggle to conform to wide
enough bounds to make everyone
happy (and anyway; I expect the distros that vendor packages have the
tooling to make this easy to
update and we do keep on top of security updates and release
frequently...)

---

Spawning from discussion in
[`#element-backend-internal:matrix.org`](https://matrix.to/#/!SGNQGPGUwtcPBUotTL:matrix.org/$VttYPPUevn2S_W_rrzg2ZOXWI6aKebk2ganTgrLEWUc?via=jki.re&via=element.io&via=matrix.org)

---------

Signed-off-by: Olivier 'reivilibre <oliverw@matrix.org>
2026-06-23 18:40:38 +01:00