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 Realtime channel options doesn’t update the options of its REST counterpart #296

Closed
ikbalkaya opened this issue Jan 17, 2022 · 0 comments · Fixed by #299
Closed
Assignees
Labels
bug Something isn't working. It's clear that this does need to be fixed.

Comments

@ikbalkaya
Copy link
Contributor

ikbalkaya commented Jan 17, 2022

Customer reports issues with channel history messages not being properly received

[Check internal discussion for details |https://ably-real-time.slack.com/archives/C8SPU4589/p1642403978004400]

The closest thing that points to that issue is in a log customer provided

Cannot construct ably realtime message from type: _Uint8ArrayView<…>

{{AblyWriter}} class in our iOS side of plugin has this method that is encoding paginated results back to the Flutter side

{code}
static AblyCodecEncoder encodePaginatedResult = ^NSMutableDictionary*(ARTPaginatedResult *const result) {
NSMutableDictionary<NSString *, NSObject *> dictionary = [[NSMutableDictionary alloc] init];
NSArray
items = [result items];
if([items count] > 0){
UInt8 type = [AblyFlutterWriter getType:items[0]];
if(type != 0){
AblyCodecEncoder encoder = [AblyFlutterWriter getEncoder: [NSString stringWithFormat:@"%d", type]];
NSMutableArray *result = [NSMutableArray arrayWithCapacity:[items count]];
[items enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
[result addObject: encoder(obj)];
}];
WRITE_VALUE(dictionary, TxPaginatedResult_type, [NSNumber numberWithInt:type]);
WRITE_VALUE(dictionary, TxPaginatedResult_items, result);
}
}
WRITE_VALUE(dictionary, TxPaginatedResult_hasNext, @([result hasNext]));

return dictionary;

};
{code}
Item types expected from that query are {{ARTMessage}}s. And those {{ARTMessage}}s have unspecified type of data properties which are likely causing the issues. Our integration tests do not raise any issues about this.

@ikbalkaya ikbalkaya added the bug Something isn't working. It's clear that this does need to be fixed. label Jan 17, 2022
@ikbalkaya ikbalkaya self-assigned this Jan 17, 2022
lawrence-forooghian added a commit to ably/ably-cocoa 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.
@QuintinWillison QuintinWillison changed the title Issue with parsing channel history on iOS platform Updating Realtime channel options doesn’t update the options of its REST counterpart Jan 20, 2022
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.

1 participant