Commit Graph
25907 Commits
Author SHA1 Message Date
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
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
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
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
Andrew Morgan ddb0c52fde Actually run MSC4429 complement tests in CI
I only just noticed that the Complement tests weren't actually running in CI...
2026-06-23 15:24:52 +01:00
Jason Robinson 50e788b9d6 Add foreign key to profile_updates_per_user.stream_id 2026-06-23 16:49:08 +03:00
Jason Robinson 8504386b1f Send down full profile of user if user has joined during incremental sync
Also refactor the "user left" to not listen to the "user_left_room" dispatch hook since we only want to do this once, thus call the profile handler immediately in the instance responsible for receiving the event.
2026-06-23 16:44:39 +03:00
16fe5fb462 Expose MSC4354 Sticky Events over MSC4186 (Simplified) Sliding Sync. (#19591)
Follows: #19487
Part of: MSC4354 whose experimental feature tracking issue is #19409

This PR implements the Sliding Sync (MSC4186) extension described in
MSC4354, allowing sliding sync clients
to receive sticky events in a reliable way.

The logic is much the same as for oldschool sync (implementation in
#19487),
although in the sliding sync extension, the client can choose their own
limit
and must control their own pagination through an extra token in the
extension request/response bodies.

Note this does not yet send down existing sticky events in the
room when the room has been newly-joined.
This newly-discovered gap is tracked at #19662 and will be addressed for
both current sync and MSC4186 SSS soon.

---------

Signed-off-by: Olivier 'reivilibre <oliverw@matrix.org>
Co-authored-by: Eric Eastwood <erice@element.io>
2026-06-23 13:04:36 +00:00
dependabot[bot]andGitHub 047d9c4231 Bump the patches group across 1 directory with 3 updates (#19835)
Signed-off-by: dependabot[bot] <support@github.com>
2026-06-23 12:45:52 +00:00
Jason Robinson 2dbaec329b Send down a null when user has left all shared rooms
Restore test and switch from {} to null.
2026-06-23 15:37:35 +03:00
Andrew MorganandJason Robinson 339eee55cd WIP track when a user leaves a room in profile_updates_per_user 2026-06-23 15:14:30 +03:00
Jason Robinson 09e212537e Fix incremental lazy sync to send down profiles for users without profile updates
Remove the checking of any stream token changes and ensure we always collect profiles for users even if they have not done profile updates, if they have events in the timeline. Also fix the cache.
2026-06-23 14:53:33 +03:00
Stefan CeriuandGitHub 6d289f7ce0 Fix permanent badge inflation from read receipts before first rotation (#19785) 2026-06-23 11:31:32 +00:00
Jason Robinson 5819dccd91 Use a cache to ensure we don't re-send the full profile fields of users in every incremental sync all the time when lazy loading 2026-06-23 13:10:21 +03:00
Jason Robinson daa8d7a28d Ensure lazy loaded profile updates in sync contain full profiles for users in timeline 2026-06-23 12:39:07 +03:00
Jason Robinson 27417cf0a8 Remove mypy ignore 2026-06-22 23:10:20 +03:00
Jason Robinson 874dc359ac Merge remote-tracking branch 'origin/develop' into anoa/msc4429 2026-06-22 22:54:16 +03:00
Maximilian BoschandGitHub 1f0c2bc3e4 docs/config: make it explicit that auto_join_rooms can be used for invite-only rooms (#19660) 2026-06-22 08:57:10 +00:00
Andrew Morgan ab9c917ca2 Remove test_incremental_sync_sends_down_null_profile_if_user_no_longer_sharing_rooms
We might just have clients do this instead (based on leave membership events).
2026-06-21 23:02:04 +01:00
Andrew Morgan 4a3fc09856 fix the tests 2026-06-21 22:53:29 +01:00
Andrew Morgan 676ef4f819 Read from profile_updates_per_user when syncing
No longer do we do the expensive lookup for which users share a room during /sync.
2026-06-21 22:40:52 +01:00
Andrew Morgan 029c4d81e4 Create profile_updates_per_user
This table tracks which users should receive profile updates. It is intended as a write-heavy, cheap-read mechanism.

At profile update time, the homeserver determines all the users that should receive the update. At the point of /sync, we then quickly read this table and check for any relevant updates for the syncing user.

The timestamp field will be used to cull the table over time (so it doesn't grow indefinitely).
2026-06-21 22:39:27 +01:00
Eric EastwoodandGitHub 42138ad602 Split out deferred and tokio_runtime to their own Rust modules (#19868)
Spawning from https://github.com/element-hq/synapse/pull/19824 /
https://github.com/element-hq/synapse/pull/19846 and wanting to use
`create_deferred` in more than just the `http_client.rs`
2026-06-19 22:21:48 -05:00
wbobandGitHub 86c6a6ca4b Log table name in "No row found" error (#19869)
Bringing it up to parity with the other 404 StoreErrors naming the table
name already.

More helpful response when debugging issues with incomplete relations.
Concretly: a user that got partly removed and then reinstated, missing
an entry in 'profiles' table.

This should also contribute to a better understanding of #2807 and #2173
2026-06-19 14:22:40 +00:00
d3fc81974a MSC1763: Implement /_matrix/client/unstable/org.matrix.msc1763/retention/configuration (#19853)
Implements https://github.com/matrix-org/matrix-spec-proposals/pull/1763
Tracking issue https://github.com/element-hq/synapse/issues/19852

This only implements the MSC's configuration endpoint and does not add
new configuration fields or options. The reason for including this is to
allow clients to run global retention against locally stored events, and
to be able to offer configuration UI.

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-18 17:37:02 +00:00
Andrew MorganandGitHub b38106d58b Update poetry in CI from 2.2.1 to 2.4.1 (#19866) 2026-06-18 15:21:55 +00:00
8cdac5297b Bump the minor-and-patches group across 1 directory with 6 updates (#19705)
Co-authored-by: Andrew Morgan <andrew@amorgan.xyz>
2026-06-18 14:48:06 +00:00
2487b31422 MSC4140: allow auth on management endpoints for delayed events (#19794)
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-18 13:27:37 +00:00
FrenchGithubUserandGitHub 75ee23a16b feat: Include allowed_room_ids in the /summary client-server API response for rooms with restricted join rules, as required by Matrix 1.15. (#19762)
Currently the `/summary` endpoint on the client and federation APIs does
not include the allowed_room_ids field, that is present on the
/hierarchy API. This is required by the 1.15 spec and this is what this
PR does.

Complement test: https://github.com/matrix-org/complement/pull/873

Part of https://github.com/element-hq/synapse/issues/18731
2026-06-18 14:12:51 +01:00
0640a3e838 Fix TCP listener startup log for ephemeral ports (#19810)
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
2026-06-18 12:58:24 +00:00
Sami OlmariandGitHub 8cd695a78a Add stable room summary endpoint in worker docs. (#19788)
---------

Signed-off-by: Sami Olmari <sami@olmari.fi>
2026-06-17 16:40:24 +01:00
Olivier 'reivilibreandGitHub 2d06667661 Fix local events being deleted despite delete_local_events=False in room versions other than 1 and 2. (#19850)
Not aware of an open ticket for this.

I came across it when I accidentally broke the feature even more (as
part of another piece of work),
then discovered there weren't tests for this.

So this is overall a low-priority drive-by fix.

Requires a fix to SyTest https://github.com/matrix-org/sytest/pull/1426
(as it depended on the bug).

<ol>
<li>

Add a test for purging rooms with `delete_local_events=False` \
Parameterised by room version, this test currently succeeds
on v2 but fails on v12.

This is because the condition checking for local events relies
on the old event ID format, which has not been used since v2.


</li>
<li>

Fix delete_local_events=False for room versions above v2 \
The event ID format changing means that we have to rely on `sender`
to know the origin of an event


</li>
</ol>

---------

Signed-off-by: Olivier 'reivilibre <oliverw@matrix.org>
2026-06-17 11:03:59 +01:00
Noah MarkertandGitHub d6d900675c resolves #19374 Refactor get_user_which_could_invite logic to reuse get_users_which_can_issue_invite. (#19732) 2026-06-16 15:34:22 +00:00
Olivier 'reivilibre e3397a9b02 Merge branch 'master' into develop 2026-06-16 16:05:25 +01:00
Eric EastwoodandGitHub f52b144c5f Explain natural behavior of events lost in the /make_join//send_join gap (#19856)
To better explain that this new thing we're doing in
https://github.com/element-hq/synapse/pull/19390 is a good citizen thing, not a requirement.

Follow-up to https://github.com/element-hq/synapse/pull/19390
2026-06-16 09:38:44 -05:00
Olivier 'reivilibre 3fad636880 1.155.0 v1.155.0 2026-06-16 14:48:25 +01:00