Skip to content

About when to send the leave event #95

@vincentfretin

Description

@vincentfretin

I see there is currently a todo comment there

janus-plugin-sfu/src/lib.rs

Lines 336 to 342 in ef815ec

// if this user is entirely disconnected, notify their roommates.
// todo: is it better if this is instead when their publisher disconnects?
if !switchboard.is_connected(&joined.user_id) {
let response = json!({ "event": "leave", "user_id": &joined.user_id, "room_id": &joined.room_id });
let occupants = switchboard.publishers_occupying(&joined.room_id);
notify_except(&response, &joined.user_id, occupants);
}

I had an issue with naf-janus-adapter master (see issue networked-aframe/naf-janus-adapter#21) where the js code can now triggers duplicate avatar on reconnect because of this part of the code I think because the users could possibly never receive the leave event. This is my hypothesis, I don't have proof that the leave event was not send when the issue occurred.

I currently don' plan to investigate this further, just wanted to document it. I currently reverted back to naf-janus-adapter 3.0.x in production.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions