ably-java icon indicating copy to clipboard operation
ably-java copied to clipboard

`useBinaryProtocol=false` is broken

Open SimonWoolf opened this issue 3 years ago • 1 comments

Specifically, when the json transport is used, it invalidly sets "timestamp":0 in published protocol messages (which should not contain a timestamp field). Realtime doesn't expect the client library to set this, and it results in a false nack from realtime.

(This is also a bug in realtime in that we should improve our validation of incoming protocol messages, which I'll fix.)

This bug was consistently reproducible -- all of the tests in RealtimeMessageTest that expect a succesful publish callback consistently fail when run on the json transport. However, the regression was seemingly not investigated at the time; rather, the failing tests (which is every test that tests realtime publishing) were all disabled with @Ignore("FIXME: fix exception"). This means that realtime publishing is now entirely untested in ably-java, which is perhaps not ideal.

┆Issue is synchronized with this Jira Task by Unito

SimonWoolf avatar Apr 06 '22 18:04 SimonWoolf

@SimonWoolf I have run all ignored tests in RealtimeMessageTest to see the issue firsthand. Unfortunately, I could not reproduce issue as only 4 of 15 tests failed in both protocols with different exceptions unrelated to the issue. Logging usage of timestamp did not yield results. Have you deployed validation on the server side? Maybe that is the reason I cannot reproduce the issue.

qsdigor avatar Nov 22 '22 12:11 qsdigor