-
Notifications
You must be signed in to change notification settings - Fork 41
Closed
Labels
bugSomething isn't working. It's clear that this does need to be fixed.Something isn't working. It's clear that this does need to be fixed.
Description
I've proved the message published contains an event name (using the Ably dev console), but in Android/Java MessageListener callback the name field is null. I believe this is because the string equality check is using "reference equality" == rather than "value equality" String.equals().
Examples of this can be found:
- https://github.com/ably/ably-java/blob/master/lib/src/main/java/io/ably/lib/types/Message.java#L85
- https://github.com/ably/ably-java/blob/v1.0.1/lib/src/main/java/io/ably/lib/types/Message.java#L85
- https://github.com/ably/ably-java/blob/v1.1.0-beta.push.1/lib/src/main/java/io/ably/lib/types/Message.java#L108
- https://github.com/ably/ably-java/blob/v1.1.0-beta.push.1/lib/src/main/java/io/ably/lib/types/Message.java#L110
The fix should be to use fieldName.equals("name"), or "name".equals(fieldName) if fieldName could ever be null.
Metadata
Metadata
Assignees
Labels
bugSomething isn't working. It's clear that this does need to be fixed.Something isn't working. It's clear that this does need to be fixed.