Unable to remove participant from subsession

Using VideoSDK for Web version 2.2.0, Chrome 138 & Edge 137

I’m creating a subsession and adding users to it as follows. This all seems to work correctly

const createResponse = await subsessionClient.createSubsessions(1);
const subsession = createResponse[0];

for (const u of participantsToAdd) {
  await subsessionClient.assignUserToSubsession(u.userId, subsession.subsessionId);
}

await subsessionClient.openSubsessions([subsession], {
  isAutoJoinSubsession: true,
  isAutoMoveBackToMainSession: true, 
  waitSeconds: 0
});

await subsessionClient.joinSubsession(subsession.subsessionId);

I don’t seem to be able to fully remove users from the subsession and return them to the main room.

Calling subsessionClient.moveBackToMainSession() does not remove the user, but instead sends the subsession-invite-back-to-main-session event to the participant regardless of the isAutoMoveBackToMainSession setting

If I handle the subsession-invite-back-to-main-session event and call subsessionClient.leaveSubsession() in the event handler, the participant becomes disconnected from the subsession (can no longer send or receive audio or video) but does not return to the main room. Changing the isBackToMainSessionEnabled setting when opening the subsession makes no difference.

At this point, the participant seems to be stuck in an ‘invited’ state.

Result of subsessionClient.getgetCurrentSubsession() call from participant

{
	"userStatus": "invited",
	"subsessionName": "Subsession 1",
	"subsessionId": "{E84F61A9-0D1D-1442-736D-5064DE9664B9}"
}

Result of subsessionClient.getSubsessionList() call from host

[{
	"subsessionId": "{E84F61A9-0D1D-1442-736D-5064DE9664B9}",
	"subsessionName": "Subsession 1",
	"userList": [
		{
			"isInSubsession": true,
			"userId": 16778240,
			"displayName": "Host",
			"userGuid": "56D0362F-C886-7012-7984-BBD26EF86762"
		},
		{
			"isInSubsession": false,
			"userId": 16793600,
			"displayName": "Participant",
			"avatar": "",
			"userGuid": "DD55D14F-C317-B0CC-ADAF-A15F75E9B8D6"
		}
	]
}]

Is there a way from here to return the participant to the main session?

Hey @Jonathan11

Thanks for your feedback.

isAutoMoveBackToMainSession

This is indeed an issue with our Video SDK, and we will fix it in the next release.

Thanks
Vic

Hi. Some versions later in 2.3.14 I still have this exact same problem.

It is somewhat cripling, as I cannot take out a user by the host from a subsession which would really be the whole point of a such a system.

Additionally, over multiple tries, even if I set the isAutoMoveBackToMainSession to true in openSubsessions, when I try to load the options with subsessionsClient.getSubsessionOptions(), the isAutoMoveBackToMainSession is always false.

Is there a workaround for this whole thing while it is solved?

Best, Peter

Hi @Peter13,

Don’t know if this will work for you, but I was able to develop a partial workaround for this issue, which might help if you’re only trying to remove the user from the call.

I used the command channel to broadcast a “disconnect:[USER_GUID]” message from the host, and had the client code respond to the command by calling client.leave() to remove themself.

Hope this helps,

Jonathan