Closed estebanabaroa closed 1 year ago
That looks good to me. Although we should add an extra option for publishing to an offline ipfs client.
In ipfs-http-client
, you need to enable allowOffline
when you call client.publish
, right now it's true by default, but it should be an actual documented option.
That looks good to me. Although we should add an extra option for publishing to an offline ipfs client.
Great you should implement it whenever you have time. You should also stop using the non public APIs in tests that do the same thing so the new APIs get tested.
In
ipfs-http-client
, you need to enableallowOffline
when you callclient.publish
, right now it's true by default, but it should be an actual documented option.
Can't we just let allowOffline on all the time? Why would the user not want to allowOffline?
Can't we just let allowOffline on all the time? Why would the user not want to allowOffline?
We could, but it's always better to be explicit about it. The user might be connecting to an offline node and publishing to it without realizing.
Can't we just let allowOffline on all the time? Why would the user not want to allowOffline?
The user might be connecting to an offline node and publishing to it without realizing.
I can't think of a real life scenario where this would cause any user issue. If the user has set up his node to be offline and tries to use plebbit with it, he will encounter many other problems, having this variable enabled won't change much imo. It's up to him to know his node configuration. There's also countless other configuration that would prevent his node from working, and we can't protect against those.
We could, but it's always better to be explicit about it.
Imo the priority is to have the least amount of APIs and options to maintain as possible. Being explicit is not a priority imo. We should only add options that are absolutely required in order for plebbit to work.
Let's say that there was another IPFS API that absolutely needed to know if the node is online/offline to work, maybe plebbitOptions.ipfsOffline?: boolean
or maybe a more general plebbitOptions.test?: boolean
could be added. But it doesn't seem to be absolutely needed for now, so we shouldn't add it.
Should be implemented on commit #2e33610eeb278f35ce841e2c9a38fbc224e1ace2
Some options are required for tests that use plebbit-js outside of plebbit-js, like plebbit-react-hooks. Options such as using a Memory DB, subplebbit/comment update time, subplebbit publish interval time, etc.
A list should be defined in this issue and then added to the readme and become public APIs.
To start I suggest:
Note: ENV vars should not be used for this as they can be used to fix a not working CI in one repo, but wont fix it in another repo.