Skip to content
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

safari ios 6.1.6 now gives "expects binary data" #78

Closed
redFrik opened this issue Apr 24, 2015 · 20 comments
Closed

safari ios 6.1.6 now gives "expects binary data" #78

redFrik opened this issue Apr 24, 2015 · 20 comments
Labels

Comments

@redFrik
Copy link
Contributor

redFrik commented Apr 24, 2015

after updating rhizome to 0.6.0 (from old install 29sept2014) i can no longer connect it to my old ipod touch (running ios 6.1.6).
both my own webapp and rhizome's own base example starts, subscribes and the rhizome.on('connected', function fires on the ipod, but after that the client locks up and no other messages are received. the rhizome server reports...

GET / 200 2ms - 1.81kb
GET /rhizome/rhizome.js 200 71ms - 267.06kb
GET /js/jquery-2.1.0.min.js 304 1ms
GET /css/styles.css 304 0ms
expects binary data

in comparison i can connect with both osx 10.10.3 and an ipad with ios 8.3. the error message "expects binary data" does not show up for these devices.

@sebpiq
Copy link
Owner

sebpiq commented Apr 24, 2015

Yes, I've had that too ... I have changed the way the messages are sent, it used to be JSON, now it is OSC-encoded binary data, so that might mean that some older browsers are not supported anymore. I have to look into it, and either reflect this in WebSocket.Client.isSupported or try to fix it if possible.

@sebpiq sebpiq added the bug label Apr 28, 2015
@sebpiq
Copy link
Owner

sebpiq commented May 21, 2015

A simple fix for this would be to have 2 possibilities of sending messages. OSC blob as is done now + something else. Possibly JSON or plain text. When the message doesn't contain a blob, the other version (JSON?) is used by default.

@sebpiq
Copy link
Owner

sebpiq commented Aug 4, 2015

This commit eab71b7 though it doesn't solve the issue at least should filter out devices that don't support rhizome (hopefully).

@redFrik it would be great if you could try with your ipod and see if rhizome.start(err) returns an error "this device is not supported"

@sebpiq sebpiq added this to the 0.7.0 milestone Aug 4, 2015
@redFrik
Copy link
Contributor Author

redFrik commented Aug 5, 2015

was just about to test the new commit (thanks) but the problem below occurred. it might be due to my new laptop and some missing dependency.

in ~/rhizome/examples/base (master)

$ rhizome config.js
/usr/local/lib/node_modules/rhizome-server/lib/connections/persistence.js:185
        state.nsTree = state.nsTree.map(function(nodeData) {
                                   ^
TypeError: Cannot read property 'map' of undefined
    at /usr/local/lib/node_modules/rhizome-server/lib/connections/persistence.js:185:36
    at fs.js:334:14
    at FSReqWrap.oncomplete (fs.js:95:15)

@sebpiq
Copy link
Owner

sebpiq commented Aug 5, 2015

Ok thanks for finding this, I added a fix 725ad51 so this doesn't happen anymore.

You might also try to delete the files with old data (by default /tmp/connections.db /tmp/events.db and /tmp/manager.json )

@sebpiq
Copy link
Owner

sebpiq commented Aug 5, 2015

Also, I don't know with which version you test, but all these fixes are not yet pushed to npm, so you need to install rhizome from the branch develop of the repository.

I you haven't done so, you can do it by running :

npm uninstall -g rhizome-server

to uninstall the old version, then install the new version with :

npm install -g git://github.com/sebpiq/rhizome.git#develop

@redFrik
Copy link
Contributor Author

redFrik commented Aug 5, 2015

still the same... expects binary data is printed in the terminal.
on the ipod i do get the example webpage and it alerts 'connected!', but when i inspect the page using laptop+safari i see WebSocket network error: The operation couldn’t be completed. No such file or directory in the console.
anything else i can test?

@sebpiq
Copy link
Owner

sebpiq commented Aug 5, 2015

damn ... I've never seen anything like that. Do you have any stack trace with the debugger?

I've modified a bit the base example, adding slightly more infos to see if we can get something meaningful. Also I prevent the socket to connect if the client doesn't support the required features (which apparently I had forgotten to do before). Could you test with this example please ?

Thanks a lot for your help :)

@redFrik
Copy link
Contributor Author

redFrik commented Aug 5, 2015

now the websocket network error is gone and i see:
ws://192.168.1.51:8000/?queueIfFull=true&id=ELeBqvnUcqXZd7Lc&os=&browser=Mozilla%2F5.0%20(iPod%3B%20CPU%20iPhone%20OS%206_1_6%20like%20Mac%20OS%20X)%20AppleWebKit%2F536.26%20(KHTML%2C%20like%20Gecko)%20Version%2F6.0%20Mobile%2F10B500%20Safari%2F8536.25
else like before (says expects binary data in terminal and connected in ios safari)

@sebpiq
Copy link
Owner

sebpiq commented Aug 5, 2015

damn ... I really need to get hold of one of these devices. That's the only way I can hope to fix this bug.

@redFrik
Copy link
Contributor Author

redFrik commented Aug 5, 2015

it's not such an important bug. i can live with it. thanks for all your effort.

@sebpiq
Copy link
Owner

sebpiq commented Aug 5, 2015

Yes, I can live with it too, but it means that some devices won't work, without any feedback to the user that it is actually not working ... and that's not good. So I'll definitely come back to this.

@sebpiq sebpiq removed this from the 0.7.0 milestone Aug 6, 2015
@kirbysayshi
Copy link

I believe this is also happening on iOS 7 as well. A friend's iPhone 5S behaves the exact same way connecting to my instance of Rhizome 0.7.0.

@sebpiq
Copy link
Owner

sebpiq commented Sep 24, 2015

Dammit! Can't find a device that would have the same problem! I have an iphone here, but it's iOS8 and works fine, and several android devices which all work ok ... So basically can't really debug. It's annoying cause I think it's a biggie. If one of you with the bug could look at it, that'd be awesome!

@kirbysayshi
Copy link

Yes, I discovered that it's extremely hard to downgrade and iOS device now too... so you have to just find one in the wild.

If I have time I'll try to debug with my friend's phone, but I'm not really sure how... haven't dug into websockets too much at a low level.

@sebpiq
Copy link
Owner

sebpiq commented Sep 27, 2015

The baseline of this bug is that the message arrives on the server side, but the server expects binary messages. Therefore I test whether a message is binary and if not, refuses it and throw an error :

https://github.com/sebpiq/rhizome/blob/master/lib/websockets/Server.js#L222

basically, I'd need to figure out exactly what is not supported by the WebSocket, and in which condition does the message arrive in the other side. If the message arrives in a readable state, but the flag binary is simply not set, maybe the line I posted above simply needs to be fixed to account for this case. So I think if you can get your hand on your friend's phone, just put a debugger instruction on that line, and test whether the flags.binary is set to false (it should be), and then whether even if it is set to false you can anyways read the message ...

@sebpiq
Copy link
Owner

sebpiq commented Oct 21, 2015

By the way, this should be resolved in master by this 05c721f and this 7366cc9 and I am now implementing automated cross-browser tests so that this won't happen again :)

@sebpiq sebpiq closed this as completed Oct 21, 2015
@redFrik
Copy link
Contributor Author

redFrik commented Jan 11, 2016

yes, i just confirmed that rhizome 0.7.1 now works with my old ios ipod. thank you.

@agargara
Copy link

agargara commented Mar 6, 2016

Thank you for fixing this! It works with my iOS 6.1 simulator now that I updated to 0.7.1.

@sebpiq
Copy link
Owner

sebpiq commented Mar 6, 2016

Glad that it works now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants