Unable to add content with the 42.0.0
xmaysonnave opened this issue · 1 comments
xmaysonnave commented
I tried to qualify the latest with our DApp and was unable to add anything.
I downgraded to the 41.0.1.
Here is the code snippet I use :
// 1 - https://github.com/ipfs/go-ipfs/issues/5683
// default chunker: "size-262144"
// chunker: "rabin-262144-524288-1048576"
// 2 - TODO: small content generates a wrong cid when cidVersion: 1 is set:
// Not a 'dag-pb' but a 'raw' multicodec instead
// We generate a V0 and convert it to a V1
// https://github.com/xmaysonnave/tiddlywiki-ipfs/issues/14
const result = await client.add(buffer, {
cidVersion: 0,
hashAlg: "sha2-256",
chunker: "rabin-262144-524288-1048576",
pin: false
});
// Check
if (result == undefined || result == null || Array.isArray(result) === false || result.length === 0) {
throw new Error("IPFS client returned an unknown result...");
}
// Convert
const cidv1 = this.cidV0ToCidV1(result[0].hash);
return {
hash: cidv1,
size: result[0].size
};
The first screenshot shows the usual array I receive when added while the second screenshot
shows an unfamiliar object, definitely not an array.
Any advise will be greatly appreciated.
Warmly
xmaysonnave commented
According to the migration guide I receive an Iterable.
I close this issue as it's irrelevant.
Thanks