Repository navigation
Eventemitter3 - #1227
Eventemitter3#1227julienmalard wants to merge 1 commit into
Conversation
ded5919 to
b3f5fdb
Compare
|
Could you share the full stack trace @silkroadnomad ? |
|
Here, this is one of the standard cases: mostly when a local DB, here on the Voyager pinning service, becomes inaccessible or corrupt (who knows why - I have some assumptions and theories, but no definite proofs), it cannot find the DB anymore on the local Helia instance. Then it tries to fetch it automatically via the block brokers / trustless gateways (of the IPFS network), but can't find it there because nobody was ever requesting it via one of those ipfs nodes (in my case). All promises get rejected because the CIDs cannot be found. I used my own OrbitDB fork, which is the same as the official one except that it includes your PR #1227. In my opinion: You can interrupt replication and break the database by switching off the network, closing a browser window, or changing code while developing locally (hot code swap). That is just my opinion and if I could proof one of those that would be it. DB's can also break when it comes to network issues. In the past e.g. some libp2p transport bug in webrtc or yamux or what not, could interrupt the replication process and make the db in accessible. Those got fixed but it doesn't fix the main question: If a replication is interrupted and hence breaks some how, can we rollback the db automatically, as we notice a failed replication (corrupt db)? Probably already before NodeJS is crashing because of an error, because it also happens in browsers out of my personal observations. Interesting is, when a db becomes inaccessible it still replicates. So then in such case even the db on voyager or other pinning nodes can become inaccessible. If you have any opinion on that, I'd be very glad to hear about it. |
|
@silkroadnomad Is it possible to wrap this in a try...catch block to try and swallow the error? |
|
@silkroadnomad Looking at this error, I have a few questions and thoughts:
|
|
@haydenyoung yes, I did like that (mentioned) in #1226 process.on('unhandledRejection', (reason, promise) => { |
|
Does it help prevent the app from crashing? |
|
@silkroadnomad if the issue has been isolated to Helia, it may be time to bring in their developers to help debug the problem. |
Sounds good. Could we consider merging this PR in the meantime? It seems that there are two issues, one here (in OrbitDb) and another in Helia that becomes apparent once this one is fixed. |
For me, yes |
|
If an app is crashing even after intercepting the error, it feels counterproductive to add more dependencies. Ideally, I think we want to replicate this error consistently and repeatedly, at least in the first instance. From there, we can build a more robust sync protocol. @silkroadnomad Do you have any example code which we can use to replicate this problem on a consistent basis, even if it takes some time for the crash to happen? We can probably escalate this issue with the Helia devs if we have something to show them. |
I am on it. Please bear with me. Fingers crossed! |

Fixes #1226 by preventing
errorevents on an eventemitter with noerrorlisteners from ending process execution.