-
Notifications
You must be signed in to change notification settings - Fork 299
Conversation
Just tested it with new updates deps, tests pass in Node.js but seems to hang in the browser. |
Got them running again locally, but seeing some other errors, probably something got lost in the rebase, investigating |
Fixed browser tests, in so far that they run through now. Looks like some of the pubsub tests are not passing yet though, probably due to timing issues with request abortion and |
The browser tests are failing because Before we ship this I would like to propose a change to this api, as I expect that this will cause more headaches down the line. So the question is to what to change the
|
It sounds like we just need to figure out how to get the xhr working, you can abort those. |
xhr can not do streaming as far as I understand, meaning we will only get the response body once it's done. So making it effectively useless for us in this case, as you subscribe to get content |
I've collected some interfaces from other places
|
It seems that.. 2017 is the year of the new HTTP(+WebSockets) API 🎆 https://github.com/ipfs/http-api-spec/issues/116 |
What are people thoughts here? Wanna consider disabling browser tests until http-api is updated, enabling people to use pubsub from Node.js? |
Update: ipfs/kubo#3522 (comment) |
Just tested with all the assertions possible and with regards to pubsub, it is 👌🏾 The only thing failing now, is name.resolve, but that seems like a new issue:
|
(that said, if anyone wants to get the work done asap, feel free to continue this PR before I get to it) |
BTW, for browser, we should probably use EventStreams, a w3c standard. Wikipedia is also using it now: https://blog.wikimedia.org/2017/03/20/eventstreams/ |
@diasdavid Addressed your CR feedback. Are we good to merge? :) |
CI not happy yet, fixing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. It needs a rebase from master and a git commit squashing
package.json
Outdated
"gulp": "^3.9.1", | ||
"hapi": "^16.1.0", | ||
"interface-ipfs-core": "~0.24.1", | ||
"interface-ipfs-core": "github:ipfs/interface-ipfs-core#fix\/pubsub-tests", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to point to the latest interface-ipfs-core
}) | ||
}) | ||
}) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it
94d8bbc
to
75ab123
Compare
Rebased and squashed. |
a04b794
to
1793e70
Compare
Discovered the need to use dirty-chai for expect. Updated and replaced the head. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small request, otherwise LGTM
src/pubsub-message-stream.js
Outdated
} catch (e) { | ||
// Not a valid pubsub message | ||
// go-ipfs returns '{}' as the very first object atm, we skip that | ||
return callback() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has this been reported? //cc @whyrusleeping @Kubuxu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a lengthy discussion about this in ipfs/kubo#3304. (short: it's always been like that, go team was involved)
src/pubsub-message-stream.js
Outdated
let msg | ||
try { | ||
msg = PubsubMessage.deserialize(obj, 'base64') | ||
} catch (e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always use err
for errors to make sure they are captured by the linter. Here, this error is being silenced.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed and amended the latest commit.
a5abedd
to
c49539d
Compare
The pubsub load tests are failing on Travis: https://travis-ci.org/ipfs/js-ipfs-api/jobs/214309202 (all travis platforms). Have no idea why. Will need to look into it tomorrow. |
Update on this from IRC:
Will catch up with @diasdavid on IRC once he's online and decide how we proceed. |
"And then d-hash showed up"
I wonder if go-ipfs has a weird way of queue the http requests to the API which makes them actually switch order. |
After some discussion on IRC and more investigation, it seems the messages in the load test get out of order on go-ipfs side. See #ipfs-dev for the full log, but here are the important parts:
And once Travis had run the tests:
So @whyrusleeping, what's your take on this? |
Floodsub does not guarantee the order in which you receive messages. They can come out of order, or not come at all |
I guess we need to take that assumption from the test then. (Still weird that in such a short network with almost 0 latency, there is disordering..) |
c49539d
to
511bd76
Compare
Rebased onto master and squashed #471