[PR #1182] [MERGED] Workaround for lack of shared DB support #2782

Closed
opened 2025-11-26 23:24:01 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/1182
Author: @mpbw2
Created: 12/16/2020
Status: Merged
Merged: 12/16/2020
Merged by: @mpbw2

Base: masterHead: litedb-cacheworkaround


📝 Commits (2)

  • 2b469af workaround for lack of shared DB support
  • 6d58e47 dispose db in finally

📊 Changes

3 files changed (+64 additions, -40 deletions)

View changed files

📝 src/Android/MainApplication.cs (+0 -1)
📝 src/Core/Services/LiteDbStorageService.cs (+64 -38)
📝 src/iOS.Core/Utilities/iOSCoreHelpers.cs (+0 -1)

📄 Description

Our DB library currently does not support shared connections across processes on Xamarin.iOS. This limitation manifests itself in our app as new or modified ciphers missing from autofill. We didn't discover this until after we enhanced our cipher caching mechanism here, when it became apparent the DB was keeping it's own cache and not recognizing modifications made by another process.

This workaround, while heavy-handed, allows our enhanced caching to function as originally intended by spinning up and disposing a DB connection for every R/W operation, giving the access layer the latest data to work with regardless of which process wrote it. Initial tests show no noticeable reduction in performance using test vaults of 1000+ ciphers. I'd like to get this into QA/CS's hands for more aggressive testing.

The maintainer of our DB library has mentioned the next major version supporting shared connections in Xamarin.iOS, at which time we can revert this entire commit and simply add Shared=true; to the connection string.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/1182 **Author:** [@mpbw2](https://github.com/mpbw2) **Created:** 12/16/2020 **Status:** ✅ Merged **Merged:** 12/16/2020 **Merged by:** [@mpbw2](https://github.com/mpbw2) **Base:** `master` ← **Head:** `litedb-cacheworkaround` --- ### 📝 Commits (2) - [`2b469af`](https://github.com/bitwarden/android/commit/2b469aff6ca4733095747e9a41746f82c6067587) workaround for lack of shared DB support - [`6d58e47`](https://github.com/bitwarden/android/commit/6d58e47e52e1cb29c886f8ec0bc8667cc80072fd) dispose db in finally ### 📊 Changes **3 files changed** (+64 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `src/Android/MainApplication.cs` (+0 -1) 📝 `src/Core/Services/LiteDbStorageService.cs` (+64 -38) 📝 `src/iOS.Core/Utilities/iOSCoreHelpers.cs` (+0 -1) </details> ### 📄 Description Our DB library currently does not support shared connections across processes on Xamarin.iOS. This limitation manifests itself in our app as new or modified ciphers missing from autofill. We didn't discover this until after we enhanced our cipher caching mechanism **[here](https://github.com/bitwarden/mobile/pull/1112),** when it became apparent the DB was keeping it's own cache and not recognizing modifications made by another process. This workaround, while heavy-handed, allows our enhanced caching to function as originally intended by spinning up and disposing a DB connection for every R/W operation, giving the access layer the latest data to work with regardless of which process wrote it. Initial tests show no noticeable reduction in performance using test vaults of 1000+ ciphers. I'd like to get this into QA/CS's hands for more aggressive testing. The maintainer of our DB library has mentioned the next major version supporting shared connections in Xamarin.iOS, at which time we can revert this entire commit and simply add `Shared=true;` to the connection string. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-26 23:24:01 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#2782