-
Notifications
You must be signed in to change notification settings - Fork 977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
socket.io client sometimes sends arrays wrong #743
Comments
looks like you are sending hash value of your 'sellCIndices' array. instead you can send content of your array using "Arrays.toString()" method. |
@shahabrar7746 Hi. In this case why this happens very seldom and most of the time array sends correctly?
So my question is, is this the bug? Should we always use Arrays.toString() while sending arrays? |
its not a bug. its like a feacture of java |
@shahabrar7746 Why this feature sometimes works, sometimes doesn't? It's the bug, but the problem is, is it server parser bug or java client. |
The emit arguments are added in a JSONArray here: socket.io-client-java/src/main/java/io/socket/client/Socket.java Lines 205 to 212 in ad3a930
Which are then stringified here: socket.io-client-java/src/main/java/io/socket/parser/IOParser.java Lines 60 to 62 in ad3a930
It seems that the Java arrays like As a temporary workaround, I think converting the arrays to a list with In the meantime, we will try to fix it in the codebase directly. |
Describe the bug
Sometimes socket.io client on android sends array of int[] wront. On server I receive something which looks like this:
SELL_COMPANIES_SELECTED: {"sellCIndices":"[I@50bf616","nexEvent":"PROCESS_GAME_FIELD"}
As you can see sellCIndices":"[I@50bf616" which is something I can't undertand.
Normally received data should look like this
SELL_COMPANIES_SELECTED: {"nexEvent":"PROCESS_GAME_FIELD","sellCIndices":[0]}
To Reproduce
Socket.IO server version:
4.6.1
Server
Socket.IO java client version:
2.1.0
Client
Expected behavior
On my server I expect to see something like "sellCIndices":[0]. But, sometimes I see strange data like "sellCIndices":"[I@50bf616"
Platform:
Additional context
This bug breaks all my application logic, it's very important to fix it or to find a workaround.
The text was updated successfully, but these errors were encountered: