ably-js icon indicating copy to clipboard operation
ably-js copied to clipboard

Understand if `whenState` can be removed from v2 API

Open lawrence-forooghian opened this issue 1 year ago • 3 comments

It's not clear to me why these methods are part of the SDK’s public API.

The first one was added in 55b1be4fde0ccf15535a89c9da2a79cd430ce181 as an "undocumented feature" used by a test case. It was then added to the typings in https://github.com/ably/ably-js/pull/444, again not sure why.

It's not in the specification, and it's not clear how the state change that it claims to emit should be populated (I guess it should probably return the state change that led to the object being in that state, but that's not what it does). This has led to bugs like #1598 and #1599.

I suggest that we remove it from the public API (i.e. the typings) in v2. (And if for some reason we do have to keep it, I'd suggest that we add it to the feature spec, properly defining what value it should emit.)

┆Issue is synchronized with this Jira Task by Unito

lawrence-forooghian avatar Jan 26 '24 16:01 lawrence-forooghian

➤ Automation for Jira commented:

The link to the corresponding Jira issue is https://ably.atlassian.net/browse/SDK-4057

sync-by-unito[bot] avatar Jan 26 '24 16:01 sync-by-unito[bot]

Raised spec PR https://github.com/ably/specification/pull/183 to add these methods (see justification there). Will address #1598 and #1599 and then implement the spec for v2.

lawrence-forooghian avatar Feb 22 '24 13:02 lawrence-forooghian

Opened #1640 to implement https://github.com/ably/specification/pull/183. #1598 and #1599 can be done separately.

lawrence-forooghian avatar Feb 28 '24 12:02 lawrence-forooghian