Skip to content

Added logging, clarified code#219

Merged
paddybyers merged 4 commits intoably:masterfrom
psolstice:RSL6_test
Nov 11, 2016
Merged

Added logging, clarified code#219
paddybyers merged 4 commits intoably:masterfrom
psolstice:RSL6_test

Conversation

@psolstice
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Member

@mattheworiordan mattheworiordan left a comment

Choose a reason for hiding this comment

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

LGTM, but need @paddybyers feedback

import io.ably.lib.types.Param;
import io.ably.lib.types.PresenceMessage;
import io.ably.lib.types.ProtocolMessage;
import io.ably.lib.types.*;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe @paddybyers is not a big fan of these broad imports, but I'll let him chime in :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It was an automatic change by IDEA.

@paddybyers
Copy link
Copy Markdown
Member

It was an automatic change by IDEA.

Well I prefer that the imports are explicit but if by default IDEA is going to give warnings about it then I don't see the point in fighting it ...

@psolstice
Copy link
Copy Markdown
Contributor Author

It gave no warning whatsoever. It just changed it. It will change it again in future if we revert it now. So I don't see the point to fight it too.

Log.e(TAG, String.format("%s on channel %s", e.errorInfo.message, name));
} catch(AblyException e) {
Log.e(TAG, "Unexpected exception decrypting message", e);
Log.e(TAG, String.format("Unexpected exception decrypting message on channel %s", name), e);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Will this only be a decrypt exception? Ie should it say "Unexpected exception decoding message" ?

Actually, what exception could occur other than a MessageDecodeException ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@paddybyers I saw the same thing, but then realised the previous code was like this before... I would agree we should instead catch MessageDecodeException if that is the exception we expect for this message, and perhaps another generic AblyException catch all?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Exception other than MessageDecodeException can be thrown only from here
[https://github.com/psolstice/ably-java/blob/RSL6_test/lib/src/main/java/io/ably/lib/types/BaseMessage.java#L105]
And as you can see it's a decryption exception

Copy link
Copy Markdown
Member

@paddybyers paddybyers left a comment

Choose a reason for hiding this comment

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

Looks good, just pls have a look at the comment/question

@paddybyers
Copy link
Copy Markdown
Member

paddybyers commented Nov 8, 2016

And as you can see it's a decryption exception

That's also a MessageDecodeException then, because an failure to decrypt is logged, and the data/encoding are left in the unencrypted state, and message processing continues (ie the message is broadcast to listeners in that state). (See http://docs.ably.io/client-lib-development-guide/features/#RSL6b)

@paddybyers
Copy link
Copy Markdown
Member

Thanks, LGTM

@paddybyers paddybyers merged commit 938073f into ably:master Nov 11, 2016
@paddybyers
Copy link
Copy Markdown
Member

LGTM, thanks

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