You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: use std::sync::Mutex for SQLite connection to avoid tokio runtime panics (#164)
Replace tokio::sync::Mutex with std::sync::Mutex for the SQLite connection.
Since rusqlite operations are inherently synchronous, there's no benefit to
using tokio's async Mutex, and blocking_lock() panics when called from within
a tokio async runtime context ("Cannot block the current thread from within a runtime").
This allows consumers to call MDK methods directly from async code without
needing to wrap calls in std::thread::spawn() to escape the runtime context.
Copy file name to clipboardExpand all lines: crates/mdk-sqlite-storage/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,6 +74,7 @@
74
74
-**Security (Audit Issue AB)**: Added size limits to prevent disk and CPU exhaustion from unbounded user input ([#94](https://github.com/marmot-protocol/mdk/pull/94))
75
75
-**Security (Audit Issue AG)**: `all_groups` now skips corrupted rows instead of failing on the first deserialization error, improving availability when database contains malformed data ([#115](https://github.com/marmot-protocol/mdk/pull/115))
76
76
- Propagate `last_message_id` parse errors in `row_to_group` instead of silently converting to `None` ([#105](https://github.com/marmot-protocol/mdk/pull/105))
77
+
- Changed `tokio::sync::Mutex` to `std::sync::Mutex` for SQLite connection to avoid panics when called from within tokio async runtime contexts ([#164](https://github.com/marmot-protocol/mdk/pull/164))
0 commit comments