Skip to content

Bug: With multiple listeners, call to dispose does not unregister #55

@QuintinKrugerMC

Description

@QuintinKrugerMC

Problem/Opportunity

The following description is based on the file listener.js

Image

When there is a single listener of a type (defined by listener_id), the call to unregister happens as expected

Image

After the splice call, the array for this listener is empty
Image

Then the if resolves as expected and the call to unregister happens successfully
Image

However when there are multiple listeners for the listener type, the if condition resolves to false and the call to unregister does not happen as expected

Image

Listener removed out of array leaving the other listeners in place after splice call is made
Image

But then the if condition resolves to false and the call to unregister does not happen as expected

Image

Steps to reproduce

  1. Ensure the thunderjs server has a listener to connect to
  2. Connect to the listener with mutliple listeners (2 atleast)
  3. Perform dispose call of one of the listeners
  4. Notice that although listener's dispose function gets executed, the call to unregister in network tab is never seen (on browser)

Expected Behavior

The call to dispose of a listener should always unregister, regardless if the number of listeners in the array of listeners for a given listener_id

Actual Behavior

The listener gets removed from the array of listeners however the network call to truly unregister for the given listener does not get made

Notes (Optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions