ably / specification

The Ably features spec for client library SDKs.
Apache License 2.0
0 stars 4 forks source link

Add `ChannelStateChange.hasBacklog` and return `ChannelStateChange` from attach/subscribe #152

Closed owenpearson closed 1 year ago

owenpearson commented 1 year ago

See ably/ably-js#1347 for discussion + example implementation.

The motivation for this change is to allow users, when using rewind=1, to wait for rewind messages to have been received (this wasn't possible before since there was no way to determine whether a rewind message is to be expected)

Returning ChannelStateChange from attach/subscribe is an API convenience which makes sense given that both methods return a promise/future/whatever resolving when the channel is attached and, by convention, information about the attachment is exposed via ChannelStateChange objects.

I don't expect there to be a demand for either of these features outside of ably-js so I've described both as optional.