Skip to content
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

Add opt-out of implicit attach when subscribing #206

Merged
merged 1 commit into from
Sep 10, 2024

Commits on Sep 9, 2024

  1. Add opt-out of implicit attach when subscribing

    Add an attachOnSubscribe channel option, which, if set to false, allows users
    to opt out of the implicit attach that’s triggered by `subscribe`-ing to
    channel or presence messages.
    
    The Chat SDK has decided that in its API, subscribing to a room’s messages or
    presence messages should not trigger a channel attach operation (see [1] for
    decision record). The JS Chat SDK uses private ably-js API to, essentially,
    call `subscribe` without triggering an implicit attach. For the Swift and
    Kotlin SDKs, we’d like to avoid this, hence this new API.
    
    I’m not sure what’s the better approach out of adding a new channel option (I
    don’t love the fact that we just ignore the user-provided “on attach” callback)
    or adding a new method called something like `subscribeWithoutAttach` (which,
    given that it’d be part of the public API, might be quite confusing for users
    when it appears in their IDE autocomplete or whatever).
    
    Resolves #202.
    
    [1] https://ably.atlassian.net/wiki/spaces/CHA/pages/3156705308/CHADR-038+API+Design+Separating+Listeners+from+Lifecycle
    lawrence-forooghian committed Sep 9, 2024
    Configuration menu
    Copy the full SHA
    ba79aba View commit details
    Browse the repository at this point in the history