question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Diposing a track with an effect doesn't call TRACK_REMOVED.

See original GitHub issue

Description

Diposing a track with an effect doesn’t call TRACK_REMOVED.


Current behavior

When I call .dispose() on a track with an effect it removes the track without calling TRACK_REMOVED. When I recreate the track it removes the track and directly add the new one (the listener TRACK_ADDED is called after the TRACK_REMOVED). If I call .setEffect() to remove the effect the behavior is the same. This is the behavior for 3 or more users if I have 2 users when I call dispose() it calls TRACK_REMOVED then directly call TRACK_ADDED with the same track.


Expected Behavior

When I call .dispose() on a track with an effect it removes the track and call TRACK_REMOVED on other users.


Possible Solution

Calling room.removeTrack(tracks[0]) before dispose() call the TRACK_REMOVED listener.


Steps to reproduce

room.on(JitsiMeetJS.events.conference.TRACK_ADDED, track => {
  console.log('add', track.getType(), track.getParticipantId(), track)
})
room.on(JitsiMeetJS.events.conference.TRACK_REMOVED, track => {
  console.log('remove', track.getType(), track.getParticipantId(), track)
})

const tracks = await JitsiMeetJS.createLocalTracks({ devices: ['video'] })
room.addTrack(tracks[0]) // call TRACK_ADDED

tracks[0].setEffect(new Effect()) // if I remove the effect it works as expected

// it works if I call `await room.removeTrack(tracks[0])`
tracks[0].dispose() // doesn't call TRACK_REMOVED

Environment details

Window 10 firefox, brave, chrome node 12.18.3 jitsi https://meet.jit.si/libs/lib-jitsi-meet.min.js


Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
maxirozaycommented, Apr 15, 2021

Thanks!

0reactions
maxirozaycommented, May 11, 2022

@jallamsetty1 thank you very much for your work.

Now the track is removed on dispose, but if there is an effect I can still see the browser’s recording icon on the tab. Unless I call setEffect before dispose. I can see in your commit that you already call setEffect in dispose so I’m not sure what is the problem.

I’m using the lib-jitsi-meet that comes with the jisti-meet 2.0.7001-1 server package.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Recycle Old Electronics - Consumer Reports
Want to donate or recycle old electronics? Consumer Reports has the details on the right way to get rid of phones, laptops, and...
Read more >
Disposal and recycling information for iPhone - Apple Support
For free recycling of your old device, a prepaid shipping label, and instructions, see the Apple Trade In website. The symbol above means...
Read more >
Implement a Dispose method - Microsoft Learn
The Dispose method performs all object cleanup, so the garbage collector no longer needs to call the objects' Object.Finalize override.
Read more >
Running side effects with reactions - MobX
How tracking works. Autorun works by running the effect in a reactive context. During the execution of the provided function, MobX keeps track...
Read more >
Managing and Reducing Wastes: A Guide for Commercial ...
Conserve resources - Reuse and recycling conserves natural resources including trees, metals and water. Track Waste. Materials and wastes offer an often ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found