Skip to content

Add soft-deleted saga experiment and documentation#2503

Merged
jeremydmiller merged 1 commit intomainfrom
soft-deleted-sagas
Apr 14, 2026
Merged

Add soft-deleted saga experiment and documentation#2503
jeremydmiller merged 1 commit intomainfrom
soft-deleted-sagas

Conversation

@jeremydmiller
Copy link
Copy Markdown
Member

Summary

  • Adds an experiment in MartenTests confirming that Marten's LoadAsync does NOT filter soft-deleted documents, so Wolverine will still load and process completed soft-deleted sagas
  • Adds documentation to docs/guide/durability/marten/sagas.md recommending the ISoftDeleted interface approach and guarding handlers against the Deleted property

Key Findings

When a saga type is configured with [SoftDeleted]:

  1. MarkCompleted()session.Delete() → Marten soft-deletes the document
  2. session.LoadAsync() still returns the soft-deleted saga (it does NOT filter)
  3. Subsequent messages to that saga ID will load and process the "completed" saga, effectively resurrecting it

The documentation recommends implementing ISoftDeleted and explicitly checking the Deleted property in handlers.

Test plan

  • saga_is_soft_deleted_when_completed — confirms LoadAsync returns soft-deleted saga
  • send_message_to_completed_soft_deleted_saga — confirms saga resurrection behavior

🤖 Generated with Claude Code

Experiment confirms that Marten's LoadAsync does not filter soft-deleted
documents, so Wolverine will still load and process completed sagas.
Documentation recommends using ISoftDeleted interface and guarding
handlers against the Deleted property.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant