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

RTL6g #205

Merged
merged 7 commits into from
Feb 22, 2016
Merged

RTL6g #205

merged 7 commits into from
Feb 22, 2016

Conversation

ricardopereira
Copy link
Contributor

❌ Not passing.

Can't publish a message of type ARTMessage: channel.publish(message, ...)

2016-02-10 15:31:37.259 xctest[4649:209394] ERROR: ARTChannel: error encoding data, status: 2029696992
/Users/ricardopereira/Repositories/Whitesmith/ably-ios/ablySpec/RealtimeClientChannel.swift:560: error: -[ablySpec.RealtimeClientChannel Channel__publish__Identified_clients_with_clientId__When_publishing_a_Message_with_clientId_set_to_null__should_be_unnecessary_to_set_clientId_of_the_Message_before_publishing_UsersricardopereiraRepositoriesWhitesmithablyiosablySpecRealtimeClientChannelswift_536] : failed: caught "NSInvalidArgumentException", "message encoding failed"
(
    0   CoreFoundation                      0x00b5ea94 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x0061fe02 objc_exception_throw + 50
    2   ably                                0x0a5a4817 -[ARTChannel encodeMessageIfNeeded:] + 487
    3   ably                                0x0a5a613b __41-[ARTRealtimeChannel publishMessages:cb:]_block_invoke + 91
    4   ably                                0x0a5ea357 -[NSArray(ARTFunctional) artMap:] + 455
    5   ably                                0x0a5a6012 -[ARTRealtimeChannel publishMessages:cb:] + 370
    6   ably                                0x0a5a5e2c -[ARTRealtimeChannel publish:withName:cb:] + 268
    7   ably                                0x0a5a5cde -[ARTRealtimeChannel publish:cb:] + 318

It is possible in JavaScript:

channel.publish({ data: 'boom!', name: 'event' });

pending("should be unnecessary to set clientId of the Message before publishing") {
let options = AblyTests.commonAppSetup()
options.autoConnect = false
options.clientId = "client_string"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test says "When publishing a Message with clientId set to null" yet you are setting the clientId?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattheworiordan Ok, I see. A little confusing because the RTL6g says Identified clients with a clientId... I thought the client needs a clientId but the message is published without a clientId (clientId attribute set to null) like I did:

let message = ARTMessage(data: "message", name: nil)
expect(message.clientId).to(beNil())

I will fix the test.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spec says "Identified clients with a clientId (as a result of either an explicitly configured clientId in ClientOptions, or implicitly through Token Auth)", but this client doesn't have a clientId, does it?

@tcard I removed the clientId ^

expect(transport.protocolMessagesSent.filter { $0.action == .Message }).toEventually(haveCount(1), timeout: testTimeout)

let messageSent = transport.protocolMessagesSent.filter({ $0.action == .Message })[0]
expect(messageSent.messages![0].clientId).to(beNil())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failing with: failed - expected to be nil, got <>

@ricardopereira
Copy link
Contributor Author

Rebased with changes.

pending("should be unnecessary to set clientId of the Message before publishing") {
let options = AblyTests.commonAppSetup()
options.autoConnect = false
let client = ARTRealtime(options: options)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spec says "Identified clients with a clientId (as a result of either an explicitly configured clientId in ClientOptions, or implicitly through Token Auth)", but this client doesn't have a clientId, does it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done
I mean, see #205 (comment)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still wrong as far as I can see. This is supposed to be testing publishing a message without an explicit clientId, yet the client must be identified i.e. with a clientId. This client is not identified

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattheworiordan @ricardopereira I've seen the discussion that @ricardopereira linked, and isn't that just what was done before? The client was being identified through ClientOptions.clientId.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not following you unfortunately. This test needs an identified client to publish a message without specifying an explicit clientId for the message. Not much more to it than that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but unless I'm reading the code very wrong, isn't that what @ricardopereira did initially and you asked him to change?

From the code snippet commented [here](8 days ago):

+                        pending("should be unnecessary to set clientId of the Message before publishing") {
+                            let options = AblyTests.commonAppSetup()
+                            options.autoConnect = false
+                            options.clientId = "client_string"

That's setting the clientId in the connection options, not in the message.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I had that before. The client with a valid clientId and the message published with no clientId.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that's the case then I apologise, I misread it the first time. Bit confused why no one pulled me up on my mistake though!

I've tried to review the rest of the code beneath the options.clientId at the time of my comment and Github is not allowing me to see that, so it's possible the message clientId was being set?

Anyway, setting a clientId is valid in the options, and setting one in the message is not valid, in the context of this test.

@ricardopereira ricardopereira force-pushed the RTL6g branch 2 times, most recently from 03ff9e1 to 8e14b9b Compare February 16, 2016 23:42
@ricardopereira
Copy link
Contributor Author

Done

@tcard
Copy link
Contributor

tcard commented Feb 19, 2016

LGTM

@ricardopereira
Copy link
Contributor Author

@mattheworiordan PTAL

ricardopereira added a commit that referenced this pull request Feb 22, 2016
@ricardopereira ricardopereira merged commit 1df2586 into master Feb 22, 2016
@ricardopereira ricardopereira deleted the RTL6g branch February 22, 2016 18:29
maratal pushed a commit that referenced this pull request Jul 19, 2023
Fix type of authCallback in IDL.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants