Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Passing Strings instead of Buffers #28

Closed
daviddias opened this issue Sep 12, 2016 · 7 comments
Closed

Passing Strings instead of Buffers #28

daviddias opened this issue Sep 12, 2016 · 7 comments
Assignees

Comments

@daviddias
Copy link
Member

Got this while testing WebSockets with go-ipfs

Debug: internal, implementation, error
    Error: Uncaught error: data must be a buffer, was: "\u0013/multistream/1.0.0\n"
    at Object.add (/Users/david/code/js-ipfs/node_modules/pull-reader/state.js:18:15)
    at /Users/david/code/js-ipfs/node_modules/pull-reader/index.js:61:15
    at /Users/david/code/js-ipfs/node_modules/pull-reader/index.js:20:7
    at WebSocket.<anonymous> (/Users/david/code/js-ipfs/node_modules/pull-ws/source.js:23:14)
    at WebSocket.onMessage (/Users/david/code/js-ipfs/node_modules/ws/lib/WebSocket.js:442:14)
@dignifiedquire
Copy link
Member

Could you please try and write a failing test case for this? That would make it easier to fix :)

@daviddias
Copy link
Member Author

@dignifiedquire absolutely, although a failing test case is hard because doing CI tests with go-ipfs is still not super smooth.

However, this seems that is a simple error coming from pull-ws, that is converting 'everything' to strings (kind of expected since WebSockets run in the browser and there is no native Buffer impl there') Will double check

@dignifiedquire
Copy link
Member

I didn't mean a CI test with go, just a simple unit test that feeds in the same data, triggering this by itself

@daviddias
Copy link
Member Author

I believe this is now fixed (bug was coming from go), please confirm @dignifiedquire

@dignifiedquire
Copy link
Member

dignifiedquire commented Sep 26, 2016

@diasdavid I never saw this error, so that's your call :)

@daviddias
Copy link
Member Author

I see. The way to test it is to make a dial from js-ipfs daemon to go-ipfs daemon while both using websockets (both have support for websockets on their master branches)

@dignifiedquire
Copy link
Member

Oh, of course I talked to @whyrusleeping to fix this..I just forgot about it. Yes this can be closed :)

github-actions bot pushed a commit that referenced this issue Dec 8, 2022
## [5.0.1](v5.0.0...v5.0.1) (2022-12-08)

### Bug Fixes

* cannot catch EADDRINUSE ([#198](#198)) ([c7312db](c7312db)), closes [#184](#184)

### Dependencies

* **dev:** bump @libp2p/interface-mocks from 7.1.0 to 8.0.2 ([#199](#199)) ([daff533](daff533)), closes [#318](https://github.com/libp2p/js-libp2p-websockets/issues/318) [#315](https://github.com/libp2p/js-libp2p-websockets/issues/315) [#313](https://github.com/libp2p/js-libp2p-websockets/issues/313) [#312](https://github.com/libp2p/js-libp2p-websockets/issues/312)
* **dev:** bump it-all from 1.0.6 to 2.0.0 ([#193](#193)) ([6213f8f](6213f8f)), closes [#28](#28) [#28](#28) [#27](#27) [#24](#24)
* **dev:** bump it-drain from 1.0.5 to 2.0.0 ([#191](#191)) ([e549691](e549691)), closes [#28](#28) [#28](#28) [#27](#27) [#24](#24)
* **dev:** bump it-take from 1.0.2 to 2.0.0 ([#192](#192)) ([4c037fc](4c037fc)), closes [#28](#28)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants