Open KyleMaas opened 3 years ago
This would still be quite a handy thing. Would going offline, using removeDB
, removeIndexes
, and removeBlobs
, and then going back online be a suitable way to do this? Is there any other state (EBT, etc.) that would be needed to support this?
Sounds about right. I think you also need to remove some EBT state and I'm not sure if the removeIndexes still work.
Looks like EBT might be able to be reset via onClose()
(which is triggered when going offline anyway), a database clear, and then updateClock()
.
This is somewhat blocked because (been a while, so I'm going from memory from several months ago now) some of the reset functions essentially did nothing. I'm thinking removeDB()
was the main issue. See https://github.com/ssb-ngi-pointer/ssb-db2/issues/198
As many times as I've managed to corrupt my local database, it would be awfully nice if there was a button I could click to scan the database and fix problems and/or a button to reset the database to clear it of anything it has synced from anywhere else leaving only my local messages, since I suspect most of the corruption I'm experiencing is due to refreshing partway through a write to the database while syncing from the pub.