You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the JS Realtime SDK v2.3.0, it seems that the callback function is never executed; the Documentation indicates that it should be called on both success and failure.
Steps to Reproduce:
Given an existing channel which has already been subscribed to, this snippet establishes presence but does not generate console output when it should: channel.presence.enter({}, function(err){ console.log(🎉); });
Changing the data payload to an invalid data type to force an error causes a Error: Data type is unsupported exception instead of executing the callback function, as in: channel.presence.enter(0, function(err){ console.log(err); });
The callbacks API for all SDK's methods has been deprecated as part of the ably-js v2 release. All methods that previously used callbacks now support promises only, hence your code sample with using promises is an intended way to use the library in v2 (you can also use async/await).
Unfortunately the API References docs you linked were not updated accordingly yet. While we're working on updating them with the latest v2 changes, you can refer to auto-generated typedoc for ably-js, or use type information from the type declaration file provided by the library (should be picked up automatically by your editor to provide correct type information).
VeskeR
added
the
documentation
Improvements or additions to public interface documentation (API reference or readme).
label
Aug 2, 2024
Using the JS Realtime SDK v2.3.0, it seems that the callback function is never executed; the Documentation indicates that it should be called on both success and failure.
Steps to Reproduce:
Given an existing
channel
which has already been subscribed to, this snippet establishes presence but does not generate console output when it should:channel.presence.enter({}, function(err){ console.log(🎉); });
Changing the data payload to an invalid data type to force an error causes a
Error: Data type is unsupported
exception instead of executing the callback function, as in:channel.presence.enter(0, function(err){ console.log(err); });
Workaround:
Chaining a promise works as expected, as in:
┆Issue is synchronized with this Jira Task by Unito
The text was updated successfully, but these errors were encountered: