Skip to content

Commit 8f1291a

Browse files
authored
Merge pull request #1758 from QMatrixClient/kitsune/lazy-loading
Spec lazy_load_members and include_redundant_members
2 parents d9135ef + 8c80669 commit 8f1291a

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

api/client-server/definitions/sync_filter.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,38 @@ properties:
6868
description: Include rooms that the user has left in the sync, default false
6969
type: boolean
7070
state:
71+
type: object
72+
title: StateFilter
7173
allOf:
7274
- $ref: room_event_filter.yaml
7375
description: The state events to include for rooms.
76+
properties:
77+
lazy_load_members:
78+
type: boolean
79+
description: |-
80+
If ``true``, the only ``m.room.member`` events returned in
81+
the ``state`` section of the ``/sync`` response are those
82+
which are definitely necessary for a client to display
83+
the ``sender`` of the timeline events in that response.
84+
If ``false``, ``m.room.member`` events are not filtered.
85+
By default, servers should suppress duplicate redundant
86+
lazy-loaded ``m.room.member`` events from being sent to a given
87+
client across multiple calls to ``/sync``, given that most clients
88+
cache membership events (see ``include_redundant_members``
89+
to change this behaviour).
90+
include_redundant_members:
91+
type: boolean
92+
description: |-
93+
If ``true``, the ``state`` section of the ``/sync`` response will
94+
always contain the ``m.room.member`` events required to display
95+
the ``sender`` of the timeline events in that response, assuming
96+
``lazy_load_members`` is enabled. This means that redundant
97+
duplicate member events may be returned across multiple calls to
98+
``/sync``. This is useful for naive clients who never track
99+
membership data. If ``false``, duplicate ``m.room.member`` events
100+
may be suppressed by the server across multiple calls to ``/sync``.
101+
If ``lazy_load_members`` is ``false`` this field is ignored.
102+
74103
timeline:
75104
allOf:
76105
- $ref: room_event_filter.yaml

api/client-server/sync.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@ paths:
134134
``timeline`` (or all state up to the start of the
135135
``timeline``, if ``since`` is not given, or
136136
``full_state`` is true).
137+
138+
N.B. state updates for ``m.room.member`` events will
139+
be incomplete if ``lazy_load_members`` is enabled in
140+
the ``/sync`` filter, and only return the member events
141+
required to display the senders of the timeline events
142+
in this response.
137143
allOf:
138144
- $ref: "definitions/state_event_batch.yaml"
139145
timeline:

0 commit comments

Comments
 (0)