cancel

suspend fun cancel(key: MutationKey)

Cancels any pending or in-flight mutation for key.

If a mutation is currently retrying or executing, it is cancelled. The persisted record (if any) is removed from store, and statusFlow for key transitions to null. Persisted records are also removed before restore has created a worker for them.

Reporting null indicates that the queue is idle for this key without introducing a new MutationStatus subclass that would break consumers with exhaustive when expressions.