ssbc / ssb-blobs

blob gossiping ssb-subprotocol
MIT License
12 stars 11 forks source link

add: make sure callback is called #17

Closed cryptix closed 5 years ago

cryptix commented 5 years ago

for some reason this code stopped working:

pull(
  pull.once(Buffer.from("foobar")),
  sbot.blbos.add(function(err, hash) {
    // this isn't called anymore
    done()
  })
)

I tried by running the tests and noticed that the cb is only present in the legacy tests and even there it isn't verified that it is called so this updated test fails right now.

cryptix commented 5 years ago

I mitigated my failing integration tests by adding pull(sbot.blobs.changes(), pull.drain(done)) but that's hardly a real fix.

cryptix commented 5 years ago

It still worked with v1.1.14.

arj03 commented 5 years ago

Ended up not merging this as it was not working because tests are async ;)

cryptix commented 5 years ago

because tests are async

can you elaborate? Is it fixed now or do I have to pin my tests on an old version now?

arj03 commented 5 years ago

Sorry that was a bit short. The test will test at the end before the add callback.

Yes it is fixed now in 1.2.2 by @austinfrey