This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
Discussion: IPFS.create({ ... }) should return same API regardless of the init
and start
options.
#3285
Labels
kind/bug
A bug in existing code (including security flaws)
kind/resolved-in-helia
status/in-progress
In progress
At the moment
IPFS.create
will return API object that has different interface depending oninit
andstart
options:js-ipfs/packages/ipfs/src/core/index.js
Lines 101 to 118 in 3ff833d
It is kind of cool that one could do that in JS (and even make TS infer it properly), but I think it has enough drawbacks that I would like to make an argument against it:
ApiManager
which introduces quite a bit complexity in exchange for unclear (at least to me) benefits.I understand that IPFS node can not provide all the core functionality when it's not initialized / started. However I would propose to either (or both):
not initialized
/not started
error(s) when specific functionality is in-operational.'unitialized | started | initialized'
states so that function that is passedIPFS API
object can asses what API subset can be used (without try catch orsubapi in
)api.init()
can returnInitilaizedAPI
instance, without mutating theapi
itself.The text was updated successfully, but these errors were encountered: