diff --git a/crates/wasm-actor/src/actor.rs b/crates/wasm-actor/src/actor.rs index c9ba97e..93d1c0a 100644 --- a/crates/wasm-actor/src/actor.rs +++ b/crates/wasm-actor/src/actor.rs @@ -50,6 +50,7 @@ impl ActorInterface for WasmActor { // 3. Call guest handle if self.handle.call(&mut self.store, (ptr, len)).is_err() { + self.store.data_mut().outbox.clear(); // discard sends from incomplete operation return; // handle trapped — drop message, keep actor alive } diff --git a/crates/wasm-actor/tests/wasm_actor.rs b/crates/wasm-actor/tests/wasm_actor.rs index 3a4735c..13f610e 100644 --- a/crates/wasm-actor/tests/wasm_actor.rs +++ b/crates/wasm-actor/tests/wasm_actor.rs @@ -743,7 +743,6 @@ fn native_actor_communicates_with_wasm_actor() { // ── Stale outbox: sends before trap leak into next handle ───────────────────── #[test] -#[ignore] // BUG: outbox not cleared on handle trap — stale entries leak into next call fn outbox_entries_from_trapped_handle_do_not_leak_into_next_call() { // A guest that calls swactor.send() successfully, then traps. // The outbox contains the send from before the trap.