zauberlabs/gnip4j

NullPointerException thrown when receiving a "delete favorite" event on the compliance stream

Closed this issue · 4 comments

When the compliance stream receives a delete favorite event, the following exception is thrown:

WARN  [] c.z.g.api.impl.DefaultGnipStream {} - Unexpected exception while consuming activity stream {your-stream-name}: null
[10.100.6.81] out: java.lang.NullPointerException: null
[10.100.6.81] out: 	at com.zaubersoftware.gnip4j.api.model.compliance.DeleteStatusActivity$Status.access$000(DeleteStatusActivity.java:38) ~[gnip4j-core-2.1.0.jar:na]
[10.100.6.81] out: 	at com.zaubersoftware.gnip4j.api.model.compliance.DeleteStatusActivity.toActivity(DeleteStatusActivity.java:49) ~[gnip4j-core-2.1.0.jar:na]
[10.100.6.81] out: 	at com.zaubersoftware.gnip4j.api.impl.formats.ComplianceActivityUnmarshaller.unmarshall(ComplianceActivityUnmarshaller.java:42) ~[gnip4j-core-2.1.0.jar:na]
[10.100.6.81] out: 	at com.zaubersoftware.gnip4j.api.impl.formats.ComplianceActivityUnmarshaller.unmarshall(ComplianceActivityUnmarshaller.java:35) ~[gnip4j-core-2.1.0.jar:na]
[10.100.6.81] out: 	at com.zaubersoftware.gnip4j.api.impl.formats.ByLineFeedProcessor.process(ByLineFeedProcessor.java:53) ~[gnip4j-core-2.1.0.jar:na]
[10.100.6.81] out: 	at com.zaubersoftware.gnip4j.api.impl.DefaultGnipStream$GnipHttpConsumer.run(DefaultGnipStream.java:229) ~[gnip4j-core-2.1.0.jar:na]
[10.100.6.81] out: 	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_72]

Because the exception is unexpected, it actually assumes that it is disconnects and immediately tries to reconnect, resulting in some thrashing of the connections.

I have a fix in the works.

Any chance the associated PR can be reviewed and incorporated in an upcoming release? Right now, I have to do special builds instead of just updating from maven central.

had to revert the pull request as UserWithheldActivity is missing.
next time try to acomodate reformatting in a separete commit (its easier to merge)

Thanks for taking a look - I submitted a new pull request. Sorry about the formatting, I must have hit the magic format code button by mistake.

This is resolved now that the code has been merged. Is it possible to get a new release cut?