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

Updating ARTRealtimeChannel’s options doesn’t update the options of its ARTRestChannelInternal #1265

Closed
lawrence-forooghian opened this issue Jan 19, 2022 · 4 comments · Fixed by #1266
Assignees
Labels
bug Something isn't working. It's clear that this does need to be fixed.

Comments

@lawrence-forooghian
Copy link
Collaborator

lawrence-forooghian commented Jan 19, 2022

When calling -[ARTRealtimeChannel setOptions:callback:], the passed options are not used to update the options of this instance’s REST channel. This means that, for example, if we update the realtime channel’s cipher options, these options will not be used to decrypt messages subsequently fetches using the -history:* methods.

I think this is something we missed when doing #1207.

This is causing ably/ably-flutter#296.

┆Issue is synchronized with this Jira Bug by Unito

@lawrence-forooghian lawrence-forooghian added the bug Something isn't working. It's clear that this does need to be fixed. label Jan 19, 2022
@lawrence-forooghian lawrence-forooghian self-assigned this Jan 19, 2022
@QuintinWillison
Copy link
Contributor

I guess the spec (RTL16, Realtime Channel#setOptions) does not explicitly state that the client library should also synchronise this across to the REST side. 🤔

There is, of course, the equivalent method for REST specified by RSL7. And I note that in the IDL there is an obscure note against RestChannel#setOptions:

asynchronous return value for compatibility with RealtimeChannel#setOptions; not required for REST-only libraries

I think there may be room for a spec improvement once this bug has been fixed.

@lawrence-forooghian
Copy link
Collaborator Author

lawrence-forooghian commented Jan 19, 2022

I think that the fact that the realtime class wraps an instance of the REST class is kind of an implementation detail; I don't think that the spec makes this explicit. So I suppose there's no reason to expect it to mention it. Perhaps the spec should however be explicit that the history calls need to make sure they respect cipher params that were passed to the top-level channel (be it realtime or REST). (Perhaps it already is, I've only scanned.)

@QuintinWillison
Copy link
Contributor

FYI, @paddybyers @SimonWoolf - in case you have any thoughts and/or historical context to share around this. Thanks.

lawrence-forooghian added a commit that referenced this issue Jan 19, 2022
When calling -[ARTRealtimeChannel setOptions:callback:], the passed
options are not used to update the options of this instance’s REST
channel. This means that, for example, if we update the realtime
channel’s cipher options, these options will not be used to decrypt
messages subsequently fetched using the -history:* methods.

I think this is something we missed when fixing #1207 (34d68ec).

This issue is causing ably/ably-flutter#296.

Closes #1265.
@SimonWoolf
Copy link
Member

SimonWoolf commented Jan 20, 2022

I think that the fact that the realtime class wraps an instance of the REST class is kind of an implementation detail

Yeah, the libs I'm more familiar with don't do this, they have a realtime channel subclass the rest channel. The idea that the spec should state that "the client library should also synchronise this across to the REST side" seems weird to me -- as far as the spec is concerned a channel is a single entity, if a lib wants to implement that with multiple communicating objects that's fine, but it's then its responsibility to not let that affect user-visible behaviour

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. It's clear that this does need to be fixed.
Development

Successfully merging a pull request may close this issue.

3 participants