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