Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(wallet): preserve pouchdb collection documents when bulkDocs fails #1518

Merged
merged 1 commit into from
Oct 25, 2024

Commits on Oct 25, 2024

  1. fix(wallet): preserve pouchdb collection documents when bulkDocs fails

    PouchDbCollectionStore.setAll used to
    1. delete all documents
    2. insert the new documents
    
    This approach has a problem that when step 2. fails, all documents from
    db are gone and not re-created. For some collections such as
    transactions or utxo this is not a problem, because it can recover, but
    for it is a big problem for WalletRepository, because there is no way
    to recover the wallets if they are lost.
    
    This fix updates setAll to perform the following steps:
    1. delete *only* the documents that are intended to be deleted
    2. upsert all new documents
    mkazlauskas committed Oct 25, 2024
    Configuration menu
    Copy the full SHA
    0caf2c4 View commit details
    Browse the repository at this point in the history