Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
cd4f422
Stub in threads sliding sync extension
devonh Oct 1, 2025
6c460b3
Stub in threads extension tests
devonh Oct 1, 2025
4602b56
Stub in early db queries to get tests going
devonh Oct 2, 2025
24b3873
Don't return empty fields in response
devonh Oct 2, 2025
9ef4ca1
Add user room filtering for threads extension
devonh Oct 3, 2025
79ea4be
Add thread_root events to threads extension response
devonh Oct 3, 2025
6e69338
Fix linter error
devonh Oct 3, 2025
4dd82e5
Add newsfile
devonh Oct 3, 2025
4c51247
Only return rooms where user is currently joined
devonh Oct 7, 2025
ab7e5a2
Properly return prev_batch tokens for threads extension
devonh Oct 8, 2025
4d7826b
Filter events from extension if in timeline
devonh Oct 8, 2025
4cb0eea
Allow SlidingSyncStreamToken in /relations
devonh Oct 9, 2025
c757969
Add indexes to improve threads query performance
devonh Oct 10, 2025
bf594a2
Move constants to designated file
devonh Oct 16, 2025
a3c7b3e
Don't fetch bundled aggregations if we don't have to
devonh Oct 17, 2025
dedd6e3
Rejig thread updates to use room lists
devonh Nov 8, 2025
46e3f67
Cleanup logic
devonh Nov 8, 2025
0c0ece9
Fix next_token logic
devonh Nov 9, 2025
cb82a4a
Handle user leave/ban rooms to prevent leaking data
devonh Nov 9, 2025
a3b34df
Run linter
devonh Nov 9, 2025
f594193
Refactor for clarity
devonh Nov 9, 2025
78e8ec6
Add test for room list filtering
devonh Nov 9, 2025
934f99a
Add wait_for_new_data tests
devonh Nov 9, 2025
003fc72
Merge branch 'develop' into devon/ssext_threads
devonh Nov 9, 2025
f778ac3
Update docstring
devonh Nov 9, 2025
6fa43cb
Comment cleanup
devonh Nov 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/19005.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add experimental support for MSC4360: Sliding Sync Threads Extension.
Copy link
Contributor

Choose a reason for hiding this comment

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

Also comments on the MSC that may change how we approach things here -> matrix-org/matrix-spec-proposals#4360 (review)

10 changes: 10 additions & 0 deletions synapse/api/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ class EventContentFields:
M_TOPIC: Final = "m.topic"
M_TEXT: Final = "m.text"

# Event relations
RELATIONS: Final = "m.relates_to"


class EventUnsignedContentFields:
"""Fields found inside the 'unsigned' data on events"""
Expand Down Expand Up @@ -360,3 +363,10 @@ class Direction(enum.Enum):
class ProfileFields:
DISPLAYNAME: Final = "displayname"
AVATAR_URL: Final = "avatar_url"


class MRelatesToFields:
"""Fields found inside m.relates_to content blocks."""

EVENT_ID: Final = "event_id"
REL_TYPE: Final = "rel_type"
3 changes: 3 additions & 0 deletions synapse/config/experimental.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,3 +593,6 @@ def read_config(
# MSC4306: Thread Subscriptions
# (and MSC4308: Thread Subscriptions extension to Sliding Sync)
self.msc4306_enabled: bool = experimental.get("msc4306_enabled", False)

# MSC4360: Threads Extension to Sliding Sync
self.msc4360_enabled: bool = experimental.get("msc4360_enabled", False)
2 changes: 0 additions & 2 deletions synapse/handlers/relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ async def get_relations(
) -> JsonDict:
"""Get related events of a event, ordered by topological ordering.

TODO Accept a PaginationConfig instead of individual pagination parameters.
Copy link
Member Author

@devonh devonh Oct 3, 2025

Choose a reason for hiding this comment

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

This has been done already, the comment just wasn't updated.


Args:
requester: The user requesting the relations.
event_id: Fetch events that relate to this event ID.
Expand Down
1 change: 1 addition & 0 deletions synapse/handlers/sliding_sync/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ async def handle_room(room_id: str) -> None:
# account data, read receipts, typing indicators, to-device messages, etc).
actual_room_ids=set(relevant_room_map.keys()),
actual_room_response_map=rooms,
room_membership_for_user_at_to_token_map=room_membership_for_user_map,
from_token=from_token,
to_token=to_token,
)
Expand Down
Loading
Loading