-
-
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
Add support for MSC3575: Sliding Sync #2242
Conversation
Mostly c/p from sync.ts. Define interfaces for MSC3575 sliding sync types. Complete WIP!
Enough to make ele-web actually load okay with 0 rooms.
Still needs some work but it's a start.
…n for list updates. - Have atomic getList/setList operations on SlidingSync to update windows etc - Add a list callback which is invoked with the list indicies and joined count.
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.
few minor comments but otherwise looks plausible!
This comment was marked as outdated.
This comment was marked as outdated.
@@ -5888,6 +5899,9 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa | |||
// There can be only room-kind push rule per room | |||
// and its id is the room id. | |||
if (this.pushRules) { | |||
if (!this.pushRules[scope] || !this.pushRules[scope].room) { | |||
return; | |||
} |
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.
Defensive programming when the server returns {}
. There's no guarantees that scope
will exist.
And ensure all the tests actually test the right things.
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.
LGTM, will block until after RC branch cut tomorrow though!
* Remove unstable support for `m.room_key.withheld` ([\matrix-org#2512](matrix-org#2512)). Fixes matrix-org#2233. * Sliding sync: add missing filters from latest MSC ([\matrix-org#2555](matrix-org#2555)). * Use stable prefixes for MSC3827 ([\matrix-org#2537](matrix-org#2537)). * Add support for MSC3575: Sliding Sync ([\matrix-org#2242](matrix-org#2242)). * Correct the units in TURN servers expiry documentation ([\matrix-org#2520](matrix-org#2520)). * Re-insert room IDs when decrypting bundled redaction events returned by `/sync` ([\matrix-org#2531](matrix-org#2531)). Contributed by @duxovni.
This PR adds API support for Sliding Sync. This is a big change and can be broken down into sliding sync specific changes and general JS SDK changes (which are inherently more risky and needs closer attention).
JS SDK changes:
IRequestOpts
inhttp-api.ts
now accepts an optionalbaseUrl
. It already accepts aprefix
but that isn't enough for sliding sync because we want to redirect/sync
requests to a different server entirely (the proxy server), hence this was added.slidingSync
has been added as a function toMatrixClient
. This function just makes a/sync
request: it doesn't handle the loop or retries.IStartClientOpts
inclient.ts
now accepts an optionalslidingSync
object, which must be of typeSlidingSync
. If this is present, JS SDK operates in Sliding Sync mode.Sliding Sync changes:
sliding-sync.ts
: contains the core sliding sync API and event loop handling. Does not handle interactions with JS SDK innards. Exposes an event emitter for sliding sync data.siding-sync-sdk.ts
: contains JS SDK <--> sliding sync data mappings. Listens for events emitted bySlidingSync
.conn-management.ts
: factored out keep-alive code. Same as sync v2 otherwise.Limitations:
sliding-sync-sdk.ts
are very bare bones currently - only state/timeline events are handled (not ephemeral/account/to-device/E2EE). This will be expanded upon in the future.Contains integration tests for
SlidingSync
. No tests exist yet forSlidingSyncSdk
.Here's what your changelog entry will look like:
✨ Features