-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clientOption for disabling resume? #374
Comments
I would support having this functionality. The alternative of |
I am not a huge fan of setting this at a connection level I am afraid. I think that will not work in a lot of cases as it's plausible (we had this with a financial customer recently) that they have some channels for live pricing info and never care about historical pricing, and other channels were continuity is important. Why set this at a connection level, when we are proposing to have channel attach flags. Related somewhat to ably/specification#80 in that in that issue too I argued we should stop forcing a developer to implement these blanket decisions at a connection level when they set up the connection. |
Sure, doing it with channel attach flags would also work. Maybe: a We really need to get on with deciding an attach flags api if we want to include it in 1.1 - #279 . Something to discuss in a couple weeks when we're all in London, maybe |
We didn't get to do that. But I did talk about overall roadmap for client libraries with @funkyboy and this is one of the future things do implement across all libraries. I think we should resurrect the discussion on what the API would be. |
We may want to consider again doing this as a clientOption on the connection level for now (even if we plan to eventually do it on a channel-by-channel basis with flags), just because it'd be so easy -- no realtime changes needed, no api change, only a single clientside option which'd be trivial to implement. Compared to a mechanism that uses channel attach flags, which has a bunch of prerequisites -- api design decisions, changes realtime-side to support new flags, and lots of clientside work to implement channel attach flags (which currently only ably-js comes close to doing). |
I would advocate doing this, even if not a formal spec item i.e. perhaps an undocumented beta feature. As @SimonWoolf suggests, this should be trivial to implement. For anyone else coming across this issue until then, our workaround for now is to, on the subscribe side, do something like client.connection.on('disconnected', () => {
client.connection.connectionManager.clearConnection();
}); with warnings that this was an internal api and may change in patch versions. This is also an |
We also need to say what the equivalent is in iOS and/or Android |
This was implemented back in 2020 on the server side usable by a |
Some people (e.g. this guy) want to avoid stale messages at all costs.
For the publishing side, we have
queueMessages: false
. But we don't currently have an easy way to avoid queueing on the subscribing side, i.e. connection state resumption - we just assume everyone wants it. Options currently are to catchdisconnected
event and eitherclose()
the connection explicitly, or callconnectionManager.clearConnection();
(or equivalent). Both are pretty bad -- the former requires the user to then have to handle reconnection logic themselves, the latter is a non-public internal api.We could solve this with a
noResume
client option that just clears connection state on disconnect with little effort, wdyt?┆Issue is synchronized with this Jira Task by Unito
The text was updated successfully, but these errors were encountered: