dsrees/JavaPhoenixClient

bindings are overwritten

dpreussler opened this issue · 4 comments

looks like there is a bug in off method of Channel

    public fun off(event: String, ref: Int? = null) {
        // Remove any subscriptions that match the given event and ref ID. If no ref
        // ID is given, then remove all subscriptions for an event.
        this.bindings = bindings
                .filter { it.first == event && (ref == null || ref == it.second) }
                .toMutableList()
    }

If I see this correctly, this removed everything from list that doenst match and not remove the one item :)

This prevents me from seeing any messages.
Maybe I am doing sth wrong but that is what debugging showed me :)

How are you calling .off()? Are you using the ref code that was returned with calling .on()?

i am not calling it at all, it is called internally and then override all my custom bindings
size = 10, then after this off call, its 1 ;)

so i never get any message callback

Looking at the code: it just keeps the one matching, it should be the other way around righjt?

👍 I see what you're talking about now. I'll be able to get to this later. Thanks for spotting it

@dpreussler fixed! Thanks for your patience and help