Multiple sessions chats not working

Hi everybody,
I’m developing a testbed website with openvidu-browser API 2.16, which would allow the users to join multiple sessions in order to chat with various users at the same time. I’ve adapted the insecure-js example.
I’m noticing a quite weird behaviour since both the signal and the publish methods refer to the last-joined session instead of the source one:

  1. a browser client “A” starts 3 sessions (session1, session2 and then session3)
    which leads to spin 3 sessions running with 3 different tokens (OK)
  2. another browser client “B” joins only the first one (session1) (OK)
  3. the client “A” starts chatting on session1 with every available user on that session (session1.signal() with empty “to” array to set the message to broadcast) (OK)
  4. right after sending out the message, the signal event caught on the session1 session1.on(‘signal’, (event) => {…
    is reported to be originated from and targeting to session3 (as logged by SignalEvent.from.session and SignalEvent.target.sessionId)
  5. the client “B” isn’t receiving the message (since its connected to the session1 only)

By testing a few different combinations seems to me that the same misbehavior affects publishing: the last joined session is always taken instead of the source one.
Since the program is quite simple (it’s basically just the insecure-js example loop adapted to run three sessions from the same page) I’d guess to be it a server-side issue? I’m running an AWS stack deployed as described here

Thanks
Stefano

Hi. You must manage different OpenVidu objects in this special use case.
For every different Session you want to manage in the very same browser/app tab, you must init a new OpenVidu() object. It is that simple.

Regards.

Ok, thank you for such a quick answer!
I guess that’s about each OV instance managing a single session (be it the only or last one)?
I’ll refactor asap the testbed according to your suggestion.

Thx
Stefano