-
Notifications
You must be signed in to change notification settings - Fork 26
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
RTL7d #209
RTL7d #209
Conversation
|
||
waitUntil(timeout: testTimeout) { done in | ||
channel.subscribeToName(testMessage.encoded.name) { message, errorInfo in | ||
expect(errorInfo).toNot(beNil()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test is failing because the errorInfo
is nil.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe errorInfo should exist in the API anyway for a message listener, instead an error message will be sent to the logger
and the message will still be delivered with last successful decoding and the encoding field
. See http://docs.ably.io/client-lib-development-guide/features/#RSL6b. I believe this test is wrong and should be checking that the encoding field is still intact i.e. it could not be decoded, and that an error is logged to the logger (if you can do this)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it does.
2e19789
to
61346af
Compare
@ricardopereira this looks good, however this only seems to test the failure condition. Should we not be testing the success condition as well where there is not an error? |
let line = logs.reduce("") { $0 + "; " + $1 } //Reduce in one line | ||
expect(line).to(contain("ERROR: ARTDataDecoded failed to decode data as 'bad_encoding_type'")) | ||
|
||
done() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not tested: "an ErrorInfo error object is emitted as an error on the Channel". (I guess this means that the error is set in RealtimeChannel.errorReason
.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As said in https://github.com/ably/ably-ios/pull/211/files#r53039010:
Although now I think "an error should be emitted on the channel" means that it should be emitted to the channel.on listeners. @mattheworiordan is this right? Should it also be set in RealtimeChannel.errorReason?
@mattheworiordan I'm checking the data & encoding (https://github.com/ably/ably-ios/pull/209/files#diff-74dac661e35645777f94b2a135363313R641). Shouldn't RSL6a take care of it? Otherwise I need to duplicate the test. |
61346af
to
c767e27
Compare
LGTM |
Sorry, I see that it's marked as pending. Still not passing? |
I need to rebase. I will do it soon. |
c767e27
to
d709147
Compare
@tcard Rebased and now it's failing with an uncaught exception: But the spec says "If there is an error decoding a message, the message is still delivered" RTL7d Log is showing: |
waitUntil(timeout: testTimeout) { done in | ||
let logTime = NSDate() | ||
|
||
channel.on(.Failed) { errorInfo in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realise we are not emitting events here, but the channel should not become failed, so this test is wrong. We don't expect this behaviour.
@ricardopereira So, mark as pending if it's not passing, right? |
Done |
LGTM |
0b80d7d
to
a6751fd
Compare
❌ Not passing.