You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Added
DecisionReadAdmissions in Cratis.Arc.Chronicle.Testing checks, without executing any command, that Chronicle admits every DecisionRead<T> parameter of the Handle and Provide methods of [ProtectedDecision] commands, including inherited ones. DecisionReadAdmissions.ShouldAdmitDecisionReadsIn(assembly) throws DecisionReadsAreRefused, listing each command, read model and DecisionReadRefusalReason, so a refused shape such as children or a reducer fails a spec instead of every execution. See Check that Chronicle admits the decision reads. (#2929)
Changed
A CommandScenario now resolves a read model, or a reducer's current state, the way production does, in every scenario and not only with UseDecisionReads(). A read model whose projection or reducer handles none of the events seeded for its event source now resolves as null instead of as an empty instance, so a non-nullable injected read model receives null; and a reducer receives null as current for its first event instead of a default instance. A spec that relied on the old behavior should seed an event the read model handles, pin the read model with .ReadModel(...), or have the reducer handle a nullcurrent. (#2928)
Fixed
A decision-mode CommandScenario (UseDecisionReads()) now provides the reads that do not guard the decision: injected read models, IReadModels.GetInstanceById and an [Unprotected] command's DecisionRead<T> are projected from the events seeded with Given.ForEventSource(...).Events(...), the same log the decision reads fold, and can be pinned with .ReadModel(...). Pinning a read model that the command takes as a protected DecisionRead<T> still throws PinnedReadModelCannotProvideDecisionToken, now naming the command and read model. (#2928)
A concurrency violation now reads "Event source '…' has new events since the command read it: expected no events, but it has events up to sequence number 0. Read it again and resubmit." instead of showing raw sentinel sequence numbers such as 18446744073709551613. (#2930)