Open AndyTWF opened 1 year ago
➤ Automation for Jira commented:
The link to the corresponding Jira issue is https://ably.atlassian.net/browse/SDK-3224
Opened PR to correct the current documentation in the short term whilst we consider the possible side-effects of fixing the bug (users may be relying on the current implementations incorrect behaviour).
https://github.com/ably/ably-java/blob/9786de65bd44c2f139a53ee235535cb7617cbc87/lib/src/main/java/io/ably/lib/util/EventEmitter.java#L41
The two implementations of EventEmitter.on() prevents the same listener from being registered multiple times (and thus being invoked multiple times per event). It should allow this to happen as per https://sdk.ably.com/builds/ably/specification/main/features/#RTE4.
Furthermore, the implementation of https://github.com/ably/ably-java/blob/9786de65bd44c2f139a53ee235535cb7617cbc87/lib/src/main/java/io/ably/lib/util/EventEmitter.java#L41 means that registering the same listener for different events (e.g. channel attachment, channel detachment) causes the first registration to be replaced with subsequent ones.
┆Issue is synchronized with this Jira Task by Unito