Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions crates/mdk-uniffi/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@

### Added

- **`clear_pending_commit` method**: Added `clear_pending_commit(group_id)` to allow callers to roll back an uncommitted pending MLS commit. ([#196](https://github.com/marmot-protocol/mdk/pull/196))

### Fixed

### Removed
Expand Down
17 changes: 17 additions & 0 deletions crates/mdk-uniffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,23 @@ impl Mdk {
Ok(())
}

/// Clear pending commit for a group
///
/// This rolls back the group to its pre-commit state — no epoch advance, no member changes.
/// Call this when publish exhausts retries to recover from failed relay publishes.
///
/// # Arguments
/// * `mls_group_id` - The MLS group ID to clear the pending commit for (hex-encoded)
///
/// # Returns
/// * `Ok(())` - if the pending commit was cleared successfully
/// * `Err` - if the group doesn't exist or another error occurs
pub fn clear_pending_commit(&self, mls_group_id: String) -> Result<(), MdkUniffiError> {
let group_id = parse_group_id(&mls_group_id)?;
self.lock()?.clear_pending_commit(&group_id)?;
Ok(())
}

/// Sync group metadata from MLS
pub fn sync_group_metadata_from_mls(&self, mls_group_id: String) -> Result<(), MdkUniffiError> {
let group_id = parse_group_id(&mls_group_id)?;
Expand Down
Loading