-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distinguish room state and timeline events in MSC2762 #4237
base: travis/msc/widgets-send-receive-events
Are you sure you want to change the base?
Distinguish room state and timeline events in MSC2762 #4237
Conversation
Once the client has finished sending `update_state` actions for all currently approved room state | ||
entries, it sends a `toWidget` request with action `room_state_synced` and an empty `data` object. | ||
This informs the widget that any room state entries for which no `update_state` action was sent *do | ||
not exist*, and the widget acknowledges the request with an empty `response` object. The client | ||
continues sending `update_state` actions whenever it observes a change in the relevant room state. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will it then also send another room_state_synced
action?
I am not sure I like the concept of room state synced. I think it does not match matrix. It gives the false impression that room state can be in sync but this is nothing we can prove with the matrix protocol.
For example there is no difference for the widget between:
- all state has been synced and then a ms later new state is received by the server (that is already 2min old) and gets send to the widget
- not all state is synced, one event is missing (2mins old) and it is synced in the next ms.
Both cases are equivalent but one gives you the state synced before the 2min old event and the other one after.
A widget using state needs to be able to deal with all possible state changes and states. Since it is required to be reactive to all scenarios one can argue that there is no special logic it can do when all state is loaded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated this according to our discussion: update_state
now sends an array so that room_state_synced
is unnecessary.
@robintown it's not clear to me if this is meant to be an MSC, or is a way to allow the team to review some changes before including in the proposal. |
It's the latter, yes |
Currently, MSC2762 is ambiguous as to whether it gives widgets a way to actually listen to the state of a room. The
read_events
action is said to only return zero or one events if you include astate_key
, which suggests that them.receive.state_event
capability is meant to expose clients to room state entries rather than simply, state events that show up in the timeline. However, there seems to be no real reason to withhold timeline events from the widget just because they happen to have astate_key
—state events may still have semantics in certain applications even if they don't belong to the resolved room state.The proposal here is to more clearly distinguish room state updates from incoming timeline events by:
read_events
always returns timeline events, rather than performing room state lookupsupdate_state
to proactively push all room state that the widget is interested in, and communicate any further updates as they occurThe idea is to make the widget API reflect the design of Simplified Sliding Sync and MSC4222 by sending the same state events twice: once to say "this is an event in the timeline" and again to say "this is a state update". In clients this has given us the means to finally track room state reliably, to guide implementations toward the "pit of success", and hopefully it'll have the same effect for widgets too.
Implementations: