-
-
Notifications
You must be signed in to change notification settings - Fork 590
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
Support MSC4222 state_after
#4487
base: develop
Are you sure you want to change the base?
Conversation
Since it must have allowed state to be undefined previously: the test had it as such.
if state can be undefined anyway
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
This was tried in the SPA (EC with this branch directly connected to a home server)
Found issueThis was caused by only storing events that come down through the timeline sync section in indexDB. |
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
There are still issues with the local storage.
This was easily testable by reloading a client and seeing all room names to disappear. With the fix from @t3chguy this is not the case anymore. But we still see issues after a reload (loading sync from cache). This can be used to investigate the issue https://pr2767--element-call.netlify.app/ If you are in a call and others join and leave, you reload the client the number at the top left will not be correct. The list of |
Thanks for continuing work on this. The changes look good as far as I can see, glad the sync accumulator wasn't too much of a big change to get working. |
This implements support for
state_after
in sync responses, as per matrix-org/matrix-spec-proposals#4222In this, the events that arrive in the timeline should no longer be added to the state of the room. Instead, all state events arrive explicitly, duplicated, in
state_after
. Applying the events instate_after
gives the state of the room after that sync request. This fixes problems where state events in the timeline should not actually change the state of the room, for example if old state events arrive from disconnected homeservers.Synapse impl: element-hq/synapse#17888
This will need aggressive testing against synapse both with and without PR 17888. It's quite an invasive change. I opted to require callers of methods that add timeline events to explicitly specify whether they want the timeline events to apply to state since defaulting to either is not really safe, and this helps us catch all the code paths where it happens.
This changes some interface in the js-sdk and so should probably be considered a breaking change (and I've removed some deprecated interfaces while I'm at it).
Changes to public functions:
SyncApi.injectRoomEvents()
- parameters have changedRoom.addLiveEvents()
-addLiveEventOptions
parameter is now requiredEventTimeline.addEvent()
-toStartOfTimeline
is now required; new required optionaddToState
EventTimelineSet.insertEventIntoTimeline()
- new required parameteraddToState
EventTimelineSet.addEventToTimeline()
- deprecated variants removed;toStartOfTimeline
is now required; new required optionaddToState
Checklist
public
/exported
symbols have accurate TSDoc documentation.