When in the same screen we enter only channels that all have the default onlyWhenActive
(which is by default true when calling channel.enter()
) → the wrong call is made to the server when going idle to update this channels
How to reproduce
-
First disable the chat plugin if you have it enabled (this is important because chat plugins makes a call in all screens to
.enter({onlyWhenActive: false}
with theonlyWhenActive
option set to false -
Add a channel for the sake of the demo. I choose
topic-presence-display.js
and I added this:
@on("init")
_init() {
this._presentChannel = this.presence.getChannel('/presence-idle-demo');
this._presentChannel.enter();
},
-
Open any topic with the browser network console opened → you should see a first call to
/presence/update
-
Minimize the browser window (with the network tab opened) and wait a little bit more than 10 seconds ( this is the browser inactivity time by default)
-
Open the browser again and look at the latest call made to
/presence/update
Current result:
While it should be leave_channels[]: /presence-idle-demo
I opened a pull request: