ipfs-blob-store
ipfs-blob-store copied to clipboard
file not available when writestream ends
File not found by the time the stream ends. (Using the cb param on createWriteStream works though)
var ws = store.createWriteStream({
key: 'cookso'
})
ws.write('hello world\n')
ws.end(function () {
var rs = store.createReadStream({
key: 'cookso'
})
rs.pipe(process.stdout)
})
the streams gets buffered and then sent through js-ipfs-api, which causes your callback to fire while the request is being made, causing a racing condition with your read. Makes sense?
This is the same issue we had with idb-blob-store. You can see a solution to this in idb-plus-blob-store.
@diasdavid: You mean go-ipfs is closing the stream before flushing? That HTTP request to go-ipfs shouldn't be closing until it's flushed it to disk.
@dignifiedquire: I think this might be something different? Do you have a write-up on that?