Skip to content
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

Runtime error when E2EE is enabled #2587

Open
TamaraFinogina opened this issue Oct 10, 2024 · 5 comments · May be fixed by #2635
Open

Runtime error when E2EE is enabled #2587

TamaraFinogina opened this issue Oct 10, 2024 · 5 comments · May be fixed by #2635

Comments

@TamaraFinogina
Copy link

Description


Runtime error when E2E is enabled due to rejection in _sendSessionInit (Tried to send session-init to ${pId} but we already have a session, here: https://github.com/internxt/lib-jitsi-meet/blob/master/modules/e2ee/OlmAdapter.js#L987)

Current behavior


Screenshot 2024-10-10 at 11 12 11

Expected Behavior


OLM channels are established without problems

Possible Solution


It is a problem in the call logic.
When E2EE is enabled, then this chain of events happens:

  • JitsiConference.prototype.toggleE2EE calls _e2eEncryption.setEnabled
  • _e2eEncryption.setEnabled calls _keyHandler.setEnabled
  • _keyHandler.setEnabled calls _setEnabled and setLocalParticipantProperty (here the issue starts)
  • _setEnabled (in ManagedKeyHandler.js) calls _olmAdapter.initSessions(), which sends _sendSessionInit to all participants with bigger IDs
  • setLocalParticipantProperty triggers SetProperty, which starts _onParticipantPropertyChanged that sends _sendSessionInit to all participants with bigger IDs AGAIN.
  • Upon a second call to _sendSessionInit the rejection is triggered:
if (olmData.session) {
            logger.warn(`Tried to send session-init to ${pId} but we already have a session`);

            return Promise.reject();
 }

Steps to reproduce


Start a conference between 3 participants on localhost via Visual Studio Code and enable E2EE. Runtime error follows.

Environment details


Google Chrome Version 129.0.6668.90 (Official Build) (arm64)
macOs Sonoma 14.6.1
Visual Studio Code Version: 1.93.1
npm 9.6.4
node 20.0.0

TamaraFinogina pushed a commit to internxt/lib-jitsi-meet that referenced this issue Oct 16, 2024
@Tusharkanta407
Copy link

There is still any issue ? I would love to solve it

@saghul
Copy link
Member

saghul commented Dec 19, 2024

You are welcome to send a PR!

@shwetd19
Copy link

shwetd19 commented Feb 9, 2025

Hi everyone! 👋

I’d love to contribute to this issue! From the description, it looks like the problem arises due to _sendSessionInit being triggered twice—once via _olmAdapter.initSessions() and again via _onParticipantPropertyChanged, leading to a rejection when a session already exists.

To tackle this, I’d start by checking whether _sendSessionInit can be conditionally triggered only when necessary. We might need to adjust how setLocalParticipantProperty interacts with _olmAdapter.initSessions() to prevent redundant calls.

Can I go ahead and work on this? Let me know if there’s any existing approach or direction you'd prefer!

@saghul
Copy link
Member

saghul commented Feb 9, 2025

Feel free to send a PR and let's discuss the approach there.

@shwetd19 shwetd19 linked a pull request Feb 10, 2025 that will close this issue
@shwetd19
Copy link

Hey @saghul I've made proposed solution PR for this Runtime issue, can you please have a look and lmk if any change is required, Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants