Skip to content

Commit 1fa0f7a

Browse files
authored
[PM-20615] Only process incoming messages once (#264)
## 🎟️ Tracking <!-- Paste the link to the Jira or GitHub issue or otherwise describe / point to where this change is coming from. --> ## 📔 Objective - Create a new thread/task and delegate message processing to it - Make sure CryptoProvider only sees each incoming message once - Make everything multi-thread safe - Enables a single thread to take ownership of message processing - but will also allow us to use the IPC framework with `BitwardenClient` ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes
1 parent f003d6c commit 1fa0f7a

17 files changed

+583
-430
lines changed

Cargo.lock

Lines changed: 49 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/bitwarden-ipc/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,22 @@ wasm = [
1515
"dep:wasm-bindgen",
1616
"dep:wasm-bindgen-futures",
1717
"dep:js-sys",
18-
"bitwarden-error/wasm"
18+
"bitwarden-error/wasm",
19+
"bitwarden-threading/wasm"
1920
] # WASM support
2021

2122
[dependencies]
2223
bitwarden-error = { workspace = true }
24+
bitwarden-threading = { workspace = true }
2325
js-sys = { workspace = true, optional = true }
26+
log = { workspace = true }
2427
serde = { workspace = true }
2528
serde_json = { workspace = true }
2629
thiserror = { workspace = true }
27-
tokio = { features = ["sync", "time"], workspace = true }
30+
tokio = { features = ["sync", "time", "rt"], workspace = true }
2831
tsify-next = { workspace = true, optional = true }
2932
wasm-bindgen = { workspace = true, optional = true }
3033
wasm-bindgen-futures = { workspace = true, optional = true }
3134

32-
[dev-dependencies]
33-
tokio = { workspace = true, features = ["rt"] }
34-
3535
[lints]
3636
workspace = true

crates/bitwarden-ipc/src/constants.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub(super) const CHANNEL_BUFFER_CAPACITY: usize = 50;

crates/bitwarden-ipc/src/error.rs

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)