Otherwise, the RoomWidgetClient class can end up accidentally sending and receiving events from rooms it didn't intend to, if it's an always-on-screen widget.
* Fix race in creating calls
We ran an async function between checking for an existing call and
adding the new one to the map, so it would have been possible to
start creating another call while we were placing the first call.
This changes the code to add the call to the map as soon as we've
created it.
Also adds more logging.
* Switch to logger.debug
* Fix unit tests
* MediaHandler Tests, part 1
Haven't got through all the methods yet
For https://github.com/vector-im/element-call/issues/544
* Didn't need these in the end
* Rest of the media handler tests
* getUserMediaStream takes args
* use mockResolvedValue
* Add .off & reuse the mock we already made
* Re-use mock handler again
* Move updateLocalUsermediaStream to beforeEach
* add .off
* Add types
* Add more .offs
* Base support for MSC3847: Ignore invites with policy rooms
Type: enhancement
* Base support for MSC3847: Ignore invites with policy rooms
Type: enhancement
* WIP: Applying feedback
* WIP: Applying feedback
* WIP: CI linter gives me different errors, weird
* WIP: A little more linting
* utils: Fix bug in deepCompare which would incorrectly return objects with disjoint keys as equal
* Fix bugs in sync test
This test wrongly asserted that `initialSyncLimit` would be used to make a filter
It is used only for the initial sync inline filter, and not in POST /filter
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
* Add types to the call unit test suites
Still involves quite a few casts to any unfortunately as it turns
out we access quite a few private methods on the Call class in these
tests.
* Remove commented line & use better expect syntax
* Replace more calls.length with toHaveBeenCalled
* Remove mistakenly added id field
This is critical for calculating client-side push rules correctly.
Without it, the push processor may think rooms have a different
number of members, resulting typically in annoying failure modes
where rooms constantly make noises because the code thinks they
are 1:1 rooms.
* 1:1 screenshare tests
Fixes https://github.com/vector-im/element-call/issues/548
* Always hang up calls after tests
to prevent hanging tests
Also fix a null dereference as we may not have an invitee or opponent
member when sending voip events if not using to-device messages.
* use mockImplementationOnce
Co-authored-by: Robin <robin@robin.town>
* use mockImplementationOnce
Co-authored-by: Robin <robin@robin.town>
* Add type on mock
* Add corresponding call.off
* Merge enable & disable screenshare tests
Co-authored-by: Robin <robin@robin.town>
* 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
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.
This can happen when you close your laptop overnight,
as the server will not hold onto in-memory resources
for your connection indefinitely. When this happen,
the server will HTTP 400 you with "session expired".
At this point, it is no longer safe to remember anything
and you must forget everything and resend any sticky
parameters. This commit does the sticky parameters and
re-establishes the connection, but it may need additional
work to make the JS SDK forget now invalid data.