Presence - Heartbeat Interval Should Be Heartbeat / 2 - 1 #33
Labels
status: accepted
This issue is accepted as valid, but it's not being worked on yet.
type: bug
This issue reports a bug.
According to the PubNub REST API | Long running heartbeat calls, the
heartbeatInterval
should "automatically" be set toheartbeat / 2 -1
:I believe that this is currently not reflected in the dart SDK.
Subscribe
Currently, the
heartbeatInterval
can be set via the SubscribeKeysetExtension:dart/pubnub/lib/src/subscribe/extensions/keyset.dart
Line 15 in 72f011d
This
heartbeatInterval
is then directly used asheartbeat
value when subscribing to a channel in SubscribeParams:dart/pubnub/lib/src/subscribe/_endpoints/subscribe.dart
Line 46 in 72f011d
Shouldn't the
heartbeat
that is sent in this request be(heartbeatInterval + 1) * 2
?PresenceWidget
In the PresenceWidget, the same
heartbeatInterval
is used both for setting the periodic Timerand as
hearbeat
sent to the serverShouldn't also there the
heartbeat
rather be(heartbeatInterval + 1) * 2
?Because with the current implementation, we got a lot of timeout presence events when the internet connection was not perfect.
Suggestion
I would strongly suggest to introduce an additional
presenceTimeout
and automatically set it to(heartbeatInterval + 1) * 2
. Or the other way around and set theheartbeatInterval
based onpresenceTimeout
, as e.g. done in the JavaScript SDK:https://github.com/pubnub/javascript/blob/499b14bf6e0802c6389e6038add9bfd37af45601/src/core/components/config.js#L263
https://github.com/pubnub/javascript/blob/403e14cac7da6820239749686251080be4760022/src/core/endpoints/subscribe.js#L56
The text was updated successfully, but these errors were encountered: