* Small tidy-up to sync.ts
* Convert doSync into a while loop
* Apply `initialSyncLimit` only to initial syncs
* Convert matrix-client-syncing spec to TS
* Add tests around initial sync filtering
* Switch confusing filterId field for `filter`
* Tweak doSync error control flow
* Fix error control flow intricacies
* use includes
* Add tests
* Fix some strict mode errors
* Fix more strict mode errors
* Fix some strict mode errors
* Fix room membership race with PREPARED event
See the call site of the original triggering event of this function: b265d795a4/src/sliding-sync.ts (L789-L806)
I think the bug is current code assumes downstream event listeners of `SlidingSyncEvent.RoomData` have synchronous execution so that by the time it emits `SlidingSyncState.Complete`, and eventually `SyncState.Prepared` the room state is correct. But since SlidingSyncSdk's `processRoomData` is async, and the membership field was being set after the async, it looks like `SlidingSyncState.Complete` was being fired before the membership field was set.
* Rm whitespace
* Initial attempt at CI to annotate new TSC errors
* Make tsconfig file valid
* enable debug
* Specify commit
* Fix commit specification
* Switch back to main
* Tweak permissions
* Add strict mode failure
* Attempt number two
* Fix ts-extra-args
* Add static analysis for tsc --strict
* Re-emit room state events on rooms
This also fixes some potential memory leaks and abuse of
removeAllListeners in sync.ts.
* Remove some stray whitespace
* Deduplicate some code to appease SonarCloud
* Name helper function more explicitly
If you leave a room you can get a lone DELETE op.
If you join a room you can get a lone INSERT op.
Up until now, we've assumed these operations happen at the ends
of the list (e.g [0] or [length-1]) which is not guaranteed as it
depends on the sort order (e.g sort alphabetically and join a room
called 'D'). In this scenario, the indexes would not be tracked
correctly. Fixed with integration tests.
* test case
* handle missing beacon info asset
* default beacon info asset type to self
* make BeaconLocationState.assetType optional
(cherry picked from commit be3e731499)
Co-authored-by: Kerry <kerrya@element.io>
This will be rolled out again later with more accompanying UI adjustments, including clearer error messages and possibly the option to disable it per-room.
this should hopefully reduce chances of
https://github.com/vector-im/element-web/issues/21541 a bit more
as we were incorrectly loading the sync accumulator even
if a sync persist was already in flight, thus wasting RAM
and increasing the chance of the renderer process OOMing
This allows clients to know when a request has been applied
on the server. This allows us to change `resend(): void` to
`resend(): Promise<string>` which resolves/rejects with the
transaction ID when it has been applied/not.