Skip to content
This repository has been archived by the owner on Sep 30, 2023. It is now read-only.

Application throws error if it's closed during heavy replication #121

Open
siepra opened this issue May 2, 2022 · 5 comments
Open

Application throws error if it's closed during heavy replication #121

siepra opened this issue May 2, 2022 · 5 comments

Comments

@siepra
Copy link

siepra commented May 2, 2022

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)

@holmesworcester
Copy link

This is causing issues for us so it would be awesome to get a fix soon!

@tabcat
Copy link
Contributor

tabcat commented May 2, 2022

Taking a look now

@tabcat
Copy link
Contributor

tabcat commented May 2, 2022

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.

@tabcat
Copy link
Contributor

tabcat commented May 2, 2022

Patched with version 0.28.5

@holmesworcester
Copy link

Thanks!!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants