Description of the assumed situation:
A browser contains a corrupted somewhat inaccessible db and adds it to a voyager instance in order to replicate/pin it.
The process timeouts at waitForReplication(db) https://github.com/orbitdb/voyager/blob/main/src/lib/handlers/add.js#L28
As it seems, it cannot get the data from the browser as usual. Helia is trying to find the data online via the TrustlessGatewayBlockBroker.retrieve and fails because the data are just not online available (because they are on the browser only)
We receive an exception and the Voyager application crashes (ends)
According to:
https://nodejs.org/api/events.html#error-events
NodeJS is ending if there is any error event rissen.
What I did in order to stop Voyager from crashing:
After createHelia, I added the following lines:
const ipfs = await createHelia({ libp2p, datastore, blockstore })
ipfs.libp2p.addEventListener('error', (err) => {
console.error('Libp2p error:', err)
})
process.on('unhandledRejection', (error) => {
console.error('Unhandled rejection:', error)
})
Voyager keeps running now but the database itself can't be replicated (pinned)