You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're getting some unexpected messages passed down to the message function. And also the padding seems to be one character too long (see the inline comment). In my debugging it looked like it could be caused by chunking, because the method would be invoked twice, first with a string with e.g. 1779 whitespace characters and immediately after that with 270 whitespace characters (1779 + 270 = 2049).
AtmosphereClientclient = ClientFactory.getDefault().newClient(AtmosphereClient.class);
AtmosphereRequestBuilderrequestBuilder = client.newRequestBuilder();
requestBuilder.transport(Request.TRANSPORT.LONG_POLLING);
requestBuilder.enableProtocol(true);
requestBuilder.trackMessageLength(true);
requestBuilder.trackMessageLengthDelimiter("|");
// The default in org.atmosphere.interceptor.PaddingAtmosphereInterceptor is 2048, but// for some reason, it's 2049 characters of padding when wasync receives it. Maybe the// newline character in the end of the line is counted?requestBuilder.paddingSize(2049);
Socketsocket = client.create();
socket.on(Event.MESSAGE, newFunction<String>() {
@Overridepublicvoidon(Stringmessage) {
// Sometimes a message with only spaces is empty is received here.
}
});
Seems like this is reproducible in an existing test (that's disabled) too: org.atmosphere.tests.LongPollingTest#noMessageLostTest. Enable the test and add a breakpoint on the assertEquals(response.get().size(), 5) line and check what the messages in the set looks like. Even easier seen by changing the type of response to AtomicReference<List> to retain the order of messages.
Nothing critical, it's easy to handle in the message function itself, but just wanted to log an issue for it in case others are seeing the same problem.
The text was updated successfully, but these errors were encountered:
We're getting some unexpected messages passed down to the message function. And also the padding seems to be one character too long (see the inline comment). In my debugging it looked like it could be caused by chunking, because the method would be invoked twice, first with a string with e.g. 1779 whitespace characters and immediately after that with 270 whitespace characters (1779 + 270 = 2049).
Seems like this is reproducible in an existing test (that's disabled) too:
org.atmosphere.tests.LongPollingTest#noMessageLostTest
. Enable the test and add a breakpoint on theassertEquals(response.get().size(), 5)
line and check what the messages in the set looks like. Even easier seen by changing the type ofresponse
toAtomicReference<List>
to retain the order of messages.Nothing critical, it's easy to handle in the message function itself, but just wanted to log an issue for it in case others are seeing the same problem.
The text was updated successfully, but these errors were encountered: