Skip to content

Commit

Permalink
Fix: Listeners not honoring multiple failures for subscription in JS (#…
Browse files Browse the repository at this point in the history
…202)

* Initial commit. Removing listener from promise list

* Using the existing remove function instead. Updated comment
  • Loading branch information
parag-pv authored Aug 7, 2024
1 parent 85d043e commit 0c00896
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion languages/javascript/src/shared/Events/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,16 @@ const doListen = function(module, event, callback, context, once, internal=false
resolve(listenerId)
}
else {
// Remove the listener from external list on failure to subscribe
// TODO: Instead of removing, the failed subscription shouldn't be put into the external list
listeners.remove(listenerId)
reject(error)
}
})
}
else {
resolve(listenerId)
}

return p
}
}
Expand Down

0 comments on commit 0c00896

Please sign in to comment.