Commit Graph

104 Commits

Author SHA1 Message Date
Robin
0ec56014c3 Remove duplicate media devices from the list
Somehow on my system Firefox always manages to create multiple entries for my webcam. This was an easy enough thing to fix.
2024-10-28 15:02:01 -04:00
Timo
c3edd3e25e
Enable lint rules for Promise handling to discourage misuse of them. (#2607)
* Enable lint rules for Promise handling to discourage misuse of them.
Squashed all of Hugh's commits into one.

---------

Co-authored-by: Hugh Nimmo-Smith <hughns@element.io>
2024-09-10 09:49:35 +02:00
fkwp
9add3e52c4 Update file headers copyright and change licence to AGPL-3.0-only 2024-09-06 10:22:13 +02:00
renovate[bot]
c2cc0937c1
Update typescript-eslint monorepo to v8 (major) (#2523)
* Update typescript-eslint monorepo to v8

* es lint fixes

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Timo <toger5@hotmail.de>
2024-09-03 17:14:27 +02:00
Richard van der Hoff
b79a405ed6
Make js-sdk imports consistent (#2590)
We need to be consistent about whether we import matrix-js-sdk from `src` or
`lib`, otherwise we get two copies of matrix-js-sdk, and everything explodes.
2024-08-29 12:37:52 -04:00
Robin
7bca541cb6
Perform dead code analysis with Knip (#2575)
* Install Knip

* Clarify an import that was confusing Knip

* Fix issues detected by Knip

Including cleaning up some unused code and dependencies, using a React hook that we unintentionally stopped using, and also adding some previously undeclared dependencies.

* Run dead code analysis in lint script and CI

---------

Co-authored-by: Timo <toger5@hotmail.de>
2024-08-28 02:06:57 +02:00
Robin
599d6fd007 Address review feedback 2024-07-12 14:15:27 -04:00
Robin
41083c0f9e Refactor settings to use observables
Also removing some unused settings along the way.
2024-07-03 15:29:32 -04:00
Timo
812ae2ce89
Load focus information from well known and use client config only as a fallback. (#2358)
* Load focus information from well known and use client config only as a fallback.

Signed-off-by: Timo K <toger5@hotmail.de>
Co-authored-by: Andrew Ferrazzutti <andrewf@element.io>
2024-06-19 16:41:52 +02:00
Robin
70fdc68b13 Fix lints 2024-06-04 11:20:25 -04:00
Timo
5284479ece
Knocking support (#2281)
* Add joining with knock room creation flow.

Also add `WaitForInviteView` after knocking.
And appropriate error views when knock failed or gets rejected.

Signed-off-by: Timo K <toger5@hotmail.de>

* Refactor encryption information.

We had lots of enums and booleans to describe the encryption situation.
Now we only use the `EncryptionSystem` "enum" which contains the
additional information like sharedKey. (and we don't use the isRoomE2EE
function that is somewhat confusing since it checks `return widget ===
null && !room.getCanonicalAlias();` which is only indirectly related to
e2ee)

Signed-off-by: Timo K <toger5@hotmail.de>

* Update recent list.

- Don't use deprecated `groupCallEventHander` anymore (it used the old
  `m.call` state event.)
- make the recent list reactive (getting removed from a call removes the
  item from the list)
- support having rooms without shared secret but actual matrix
  encryption in the recent list
- change the share link creation button so that we create a link with
  pwd for sharedKey rooms and with `perParticipantE2EE=true` for matrix
  encrypted rooms.

Signed-off-by: Timo K <toger5@hotmail.de>

* fix types

Signed-off-by: Timo K <toger5@hotmail.de>

* patch js-sdk for linter

Signed-off-by: Timo K <toger5@hotmail.de>

* ignore ts expect error

Signed-off-by: Timo K <toger5@hotmail.de>

* Fix error in widget mode.

We cannot call client.getRoomSummary in widget mode. The code path needs
to throw before reaching this call. (In general we should never call
getRoomSummary if getRoom returns a room)

Signed-off-by: Timo K <toger5@hotmail.de>

* tempDemo

Signed-off-by: Timo K <toger5@hotmail.de>

* remove wait for invite view

Signed-off-by: Timo K <toger5@hotmail.de>

* yarn i18n

Signed-off-by: Timo K <toger5@hotmail.de>

* reset back mute participant count

* add logic to show error view when getting removed

* include reason whenever someone gets removed from a call.

* fix activeRoom not beeing early enough

* fix lints

* add comment about encryption situation

Signed-off-by: Timo K <toger5@hotmail.de>

* Fix lockfile

* Use (unmerged!) RoomSummary type from the js-sdk

Temporarily change the js-sdk dependency to the PR branch that provides
that type

* review

Signed-off-by: Timo K <toger5@hotmail.de>

* review (remove participant count unknown)

Signed-off-by: Timo K <toger5@hotmail.de>

* remove error for unencrypted calls (allow intentional unencrypted calls)

Signed-off-by: Timo K <toger5@hotmail.de>

* update js-sdk

Signed-off-by: Timo K <toger5@hotmail.de>

---------

Signed-off-by: Timo K <toger5@hotmail.de>
Co-authored-by: Andrew Ferrazzutti <andrewf@element.io>
2024-04-23 22:15:13 +09:00
Robin
257211e8f9 Try disabling LiveKit web audio support
We think there's a chance this is causing some Edge users to not hear any audio.
2024-04-19 13:02:51 -04:00
Timo
379050ff80
Add back posthog connection time tracking (#2316)
Signed-off-by: Timo K <toger5@hotmail.de>
Co-authored-by: Robin <robin@robin.town>
2024-04-16 17:21:37 +02:00
Timo
9f4a107865
Revert "Track connection time on posthog (#2313)" (#2315)
This reverts commit 5e2b652690.
2024-04-16 16:21:07 +02:00
Timo
5e2b652690
Track connection time on posthog (#2313) 2024-04-16 11:48:11 +02:00
Robin
51cc406af7 Experiment with different timeouts
This lets you set the global variables peerConnectionTimeout and websocketTimeout to see what LiveKit does with different values.
2024-04-15 10:38:18 -04:00
Robin
5502f588eb Fix errors 2024-02-09 11:22:36 -05:00
Murat Ersin
f25f5776a0
The resolved bug comment for Livekit has been deleted. (#2015)
This comment has been deleted to avoid confusion because the mentioned issue has been resolved with livekit-client version 1.15.5.
2024-01-02 14:53:53 +01:00
Robin
c25d54ef75 Upgrade @livekit/components-core 2023-12-04 11:12:25 -05:00
Robin
169ccd9de5 Start refactoring some business logic into view models
As Element Call grows in complexity, it has become a pain point that our business logic remains so tightly coupled to the UI code. In particular, this has made testing difficult, and the complex semantics of React hooks are not a great match for arbitrary business logic. Here, I show the beginnings of what it would look like for us to adopt the MVVM pattern. I've created a CallViewModel and TileViewModel that expose their state to the UI as rxjs Observables, as well as a couple of helper functions for consuming view models in React code.

This should contain no user-visible changes, but we need to watch out for regressions particularly around focus switching and promotion of speakers, because this was the logic I chose to refactor first.
2023-12-01 17:09:21 -05:00
Robin
c433069f90 Format code 2023-11-30 23:40:33 -05:00
renovate[bot]
8bb114d7d4
Update dependency @livekit/components-react to v1.4.1 (#1923)
* Update dependency @livekit/components-react to v1.4.1

* patch to match new lk api

Signed-off-by: Timo K <toger5@hotmail.de>

---------

Signed-off-by: Timo K <toger5@hotmail.de>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Timo K <toger5@hotmail.de>
2023-11-28 20:01:12 +01:00
David Baker
861d8ec016 Fix joining calls with no media permission
You can still try to unmute your media in the preview screen and
the button will show unmuted, but then mute again once you actually
join, so not 100% perfect but better.

Fixes https://github.com/vector-im/element-call/issues/1907
Fixes https://github.com/vector-im/element-call/issues/1661
2023-11-20 18:49:08 +00:00
David Baker
081c42f5bc
Merge pull request #1892 from vector-im/dbkr/focus_switch_keep_screenshare
Keep screenshares when switching focus
2023-11-16 09:39:17 +00:00
David Baker
57ca5d1713 Another comment 2023-11-15 16:23:06 +00:00
David Baker
56c4ad088f
Merge pull request #1891 from vector-im/dbkr/require_e2eeconfig
Make E2EEConfig required
2023-11-15 16:13:17 +00:00
David Baker
c146e83c15 Keep screenshares when switching focus
This also removes the use of the useLivekitRoom hook: we had reached
the point where the only thing it was actually doing was disconnecting,
so we now do that in the onClick handler for the leave button (I don't
think we need to disconnect on unmount?). It was otherwise just getting in
the way and causing tracks to be enabled/disabled when we didn't want them
to be. This also removes the need for the blockAudio code.

Fixes https://github.com/vector-im/element-call/issues/1413
2023-11-10 15:24:43 +00:00
David Baker
5ab6d18712 Make E2EEConfig required
Previously it could be either undefined or type None which meant the
same thing: no need to have both, just make it required.

This also means we can move the line to set e2ee enabled into a more
sensible place rather than in the ActiveCall de-nulling wrapper.
2023-11-10 11:54:59 +00:00
David Baker
e4e721818a Close precreated tracks if we never add them
As the log line says, this should never happen, but if it does we
still shouldn't leak tracks.
2023-11-10 11:18:20 +00:00
David Baker
731f1e4008
Merge pull request #1772 from vector-im/dbkr/ppe2ee
Support key-per-participant e2ee
2023-10-31 20:08:05 +00:00
David Baker
49c90a4612 Amalgamate E2EEMode & E2eeType 2023-10-30 17:06:59 +00:00
David Baker
bc0d679d50 Add sentry message if we hit the extra mic check
If we hit the condition detecting that we're trying to add an extra
mic input, send a sentry message so we know if this is happening in
the wild.
2023-10-27 16:18:00 +01:00
David Baker
2d5b4dbc57 Merge remote-tracking branch 'origin/livekit' into dbkr/ppe2ee 2023-10-26 10:29:12 +01:00
Timo
8356b722a6
Add limit condition to sync loop and add more logging what is actually going on. (#1775)
---------

Signed-off-by: Timo K <toger5@hotmail.de>
2023-10-25 13:44:33 +02:00
David Baker
15d3e7574d Re-apply Simon's emebdded e2ee work on latest livekit branch
Replaces https://github.com/vector-im/element-call/pull/1350
2023-10-16 17:45:06 +01:00
David Baker
2faf9527a0 Fix using a non-default audio device
We were passing the output option when we wanted the input, so the
mic track pre-creation would just always use the system default.
2023-10-13 13:34:25 +01:00
David Baker
61d7adf0d4
Merge pull request #1740 from vector-im/dbkr/log_mic_and_focus
Add logging & guards for mic pre-creation & focus
2023-10-13 10:34:41 +01:00
Timo
5262af7000
Fix sync loop by adding a 20ms break for the next mute sync (#1742)
* fix sync loop by adding a 20ms break for the next mute sync

---------

Signed-off-by: Timo K <toger5@hotmail.de>
2023-10-12 10:51:37 +02:00
David Baker
11664a5bf6 Prettier 2023-10-11 16:27:17 +01:00
David Baker
a9c74172a5 Add logging & guards for mic pre-creation & focus
Logs & guard for pre-recating the mic track as well as logging what
we select as the active focus (JWT URL + livekit alias).
2023-10-11 16:07:46 +01:00
Robin
614bc82402 Format code 2023-10-11 10:42:04 -04:00
Robin
cc6f1f8631 Merge branch 'livekit' into eslint-upgrade 2023-10-11 10:30:57 -04:00
Timo
d5edcce470
Fix mute button not being in sync with actual video/audio feed. (#1721)
* Fix mute button not being in sync with actual video/audio feed.
This happens if we toggle the button while waiting for updating the stream.
It is prohibited by checking if the stream state is in sync after the update
is done.
Signed-off-by: Timo K <toger5@hotmail.de>


---------

Signed-off-by: Timo K <toger5@hotmail.de>
2023-10-10 14:14:39 +02:00
David Baker
c37b2924af Comment 2023-10-03 18:27:10 +01:00
David Baker
e0cabbc514 Switch capture devices if the default device changes
This is a bit of a hack, but is the only way I can see that we can
update to using the new default device when the OS-level default
changes. Hopefully the comments explain everything.
2023-10-03 18:22:56 +01:00
David Baker
4613d43c3c Re-enable livekit rageshake logging & with depth limit
Puts livekit logs back in the rageshake logs and adds a recursion
limit to the object serialiser in rageshake.
2023-09-26 12:08:08 +01:00
David Baker
b0f63eb2ff
Revert "Capture livekit's logs in rageshakes" 2023-09-25 09:32:32 +01:00
Robin
a7624806b2 Upgrade eslint-plugin-matrix-org to 1.2.1
This upgrade came with a number of new lints that needed to be fixed across the code base. Primarily: explicit return types on functions, and explicit visibility modifiers on class members.
2023-09-22 18:07:06 -04:00
David Baker
9bf0dc7dee Unused import 2023-09-21 16:58:02 +01:00
David Baker
9c878eab80 Capture livekit's logs in rageshakes 2023-09-21 16:50:31 +01:00