Commit Graph

9 Commits

Author SHA1 Message Date
Robin
b0587fcfb3 Avoid reactivity bugs in how we track external state (#3316)
* Avoid reactivity bugs in how we track external state

Many of our hooks which attempt to bridge external state from an EventEmitter or EventTarget into React had subtle bugs which could cause them to fail to react to certain updates. The conditions necessary for triggering these bugs are explained by the tests that I've included.

In the majority of cases, I don't think we were triggering these bugs in practice. They could've become problems if we refactored our components in certain ways. The one concrete case I'm aware of in which we actually triggered such a bug was the race condition with the useRoomEncryptionSystem shared secret logic (addressed by a1110af6d5).

But, particularly with all the weird reactivity issues we're debugging this week, I think we need to eliminate the possibility that any of the bugs in these hooks are the cause of our current headaches.

* Reuse useTypedEventEmitterState in useLocalStorage

* Fix type error
2025-06-05 13:54:57 +02:00
Timo
2f3e0b419d Leave issue refactor (#3302)
* Simplify key local storage management.

* Refactor useLivekit to only ever connect to one room.
This change also tries to make the code more explicit so that we only do the things we really need to do and rely less on react updating everything correctly.

It also surfaces, that we are currently implementing useLivekit in a way, so that we can change the encryption system on the fly and recreate the room. I am not sure this is a case we need to support?

* simplify the useLivekit hook even more
This is possible because we concluded that we do not need to be able to hot reload the e2ee system.

* review

* linter

* Update src/room/InCallView.tsx

Co-authored-by: Robin <robin@robin.town>

---------

Co-authored-by: Robin <robin@robin.town>
2025-06-04 20:51:13 +00:00
Timo
a1110af6d5 Fix the actual leaving issue 2025-05-27 17:38:54 +02:00
Hugh Nimmo-Smith
0f5dc33918 Fix copyright header to say dual license not just AGPL (#3013)
This probably should have been part of https://github.com/element-hq/element-call/pull/2984
2025-02-18 17:59:58 +00:00
fkwp
9add3e52c4 Update file headers copyright and change licence to AGPL-3.0-only 2024-09-06 10:22:13 +02: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
70fdc68b13 Fix lints 2024-06-04 11:20:25 -04:00
Robin
614bc82402 Format code 2023-10-11 10:42:04 -04:00
Šimon Brandner
c4e5e1afb1 Save room shared keys to local storage
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
2023-08-09 14:01:36 +02:00