-
-
Notifications
You must be signed in to change notification settings - Fork 595
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
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]>
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. |
…er field Signed-off-by: Michael Telatynski <[email protected]>
…kr/stateafter # Conflicts: # src/embedded.ts
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
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.
I only have minor comments. Nice that there is also the test to the sync accumulator
Signed-off-by: Michael Telatynski <[email protected]>
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.
crypto changes look fine
Is there anything else we should wait for before merging this? This mentions the EW pr needs to be merged first: element-hq/element-web#28398 |
Yes, it will need force merging when I am done with the release process |
Closes #4532
Fixes element-hq/element-web#28536
Fixes #4528
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.