Repository navigation
GH-5296 Query saga instances by saga type: filters, ordering, paging and counts - #5301
Merged
Merged
Conversation
…and counts Adds ISagaStoreDiagnostics.QuerySagasAsync and GetQueryCapabilities (default-implemented), reusing JasperFx DocumentQueryOptions and ApplyCriteriaTo. Marten, EF Core and RavenDB filter, order, page and count; the lightweight RDBMS storages (which Polecat and Fisher use) page, count and order by id and refuse Where/OrderBy. ListSagaInstancesAsync is now ordered by saga identity on every storage. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This was referenced Nov 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5296
Adds
ISagaStoreDiagnostics.QuerySagasAsync(sagaTypeName, DocumentQueryOptions, ct)returningSagaQueryResult(page + total count), andGetQueryCapabilities(sagaTypeName)so a UI knows up front what a storage can do. Both are default-implemented, so older storages still load. The aggregator routes by saga type.Shared rules live in
SagaQueryCriteria: page size clamped to 1000, unordered queries ordered by identity, unsupported criteria (IdEquals, metadata filters, tenant) and anyWhere/OrderBya storage cannot honour throwDocumentCriteriaNotSupportedException, never an unfiltered page. AOT reports paging-only.ApplyCriteriaTo(tested against Postgres)Set<T>().AsNoTracking()(tested against SQL Server)ISagaStoreDiagnosticsat all. Split to #5300Ordering of
ListSagaInstancesAsyncis now defined: saga identity ascending, as the store compares the key (SQL Server orders a uniqueidentifier by its own byte order). It says nothing about recency; the doc comment now says so.Polecat and Fisher register the lightweight diagnostics, so they are paging-only here rather than forwarding to their
IDocumentStoreDiagnostics. Doing that would be a follow-up if filtering there matters.🤖 Generated with Claude Code