Application throws error if it's closed during heavy replication
siepra opened this issue · comments
orbit-db: 0.28.4
orbit-db-store: 4.3.3
TypeError: Cannot read properties of null (reading 'length')
at Replicator.onReplicationProgress (...\orbit-db-store\src\Store.js:98:25)
at onProgressCallback (...\orbit-db-store\src\Replicator.js:147:14)
Here is the demo https://github.com/siepra/closeorbitdb
Also I tried enhancing the if statement in Store.js:98
with if (this._oplog &&
but going further results in different error (also reachable in the sample repo I posted above)
This is causing issues for us so it would be awesome to get a fix soon!
Taking a look now
For now I'll make a patch that just doesn't error when closing the store during replication - by having .close wait for currently processing replication to finish. In future versions it will be good to do things like abort ipfs block/dag calls to stop the replication more abruptly.
Patched with version 0.28.5
Thanks!!