-
Notifications
You must be signed in to change notification settings - Fork 18
SessionError: A session has already been opened #30
Comments
Are you facing this issue in this getting started project or in your own? |
In my own. I just realized this is the wrong place probably. Apologies. |
No it's all good, we can try to resolve it right here. |
We are using the SDK in an Angular application and in a Chrome extension. I don't think in either of those alone concurrent calls can happen. But usually an user will open a session from both the app and the Chrome extension. So user will have 2 sessions running. Then sometimes user will connect to a conference from the Chrome extension, and other times from the app. Should we perhaps be using a separate externalId for the user's session in the Angular application and the Chrome extension? |
The web app and the chrome extensions should not be sharing the same context so opening a session in each should be completely fine. Using the same externalId for both session however might trigger some issues if you try to join the same conference as one session will get kicked out of the conference (you can't have the same user connected twice to the same conference). When this issue happens, do you see any errors in the console logs of the browser? (besides that you can't open a session since one is already opened). Could confirm if your code is calling multiple times the |
It seems like there are no other related logs when this happens (I don't know how to reproduce this on my own machine, I'm seeing this happen to a few of my users via Datadog logs). The code does call VoxeetSDK.session.isOpen() multiple times during a session.. and then it calls VoxeetSDK.session.open() if the session happens to be not open... also multiple times theoretically. But unlikely to happen concurrently and from the logs I don't see any concurrent calls within one tab. A user can also have the Chrome extension code running in multiple tabs.. then a session per each tab. This issue seems to be limited to a small subset of users, but it causes critical issues when it happens. |
This should not have an impact as each tab (or Chrome extensions) are isolated from one another. I suspect it could be that while the session is opening, another call to As a workaround, until we figure out the exact problem, I would use something like that: if (!VoxeetSDK.session.isOpen()) {
const user = { name: 'testname', externalId: 1 };
try {
await VoxeetSDK.session.open(user);
} catch (error) {
if (error.message !== 'A session has already been opened') {
throw error;
}
}
} |
if (!VoxeetSDK.session.isOpen()) { await VoxeetSDK.session.open({ name: 'testname', externalId: 1 }); }
Intermittently this code is producing an error:
"SessionError: A session has already been opened"
How can this be possible? We've taken care to check that a session is not open before we try to open one, but still it sometimes throws this error.
The text was updated successfully, but these errors were encountered: