Add Chronicle query scenarios and release unexpected snapshot streams in tests - #88
Merged
Merged
Conversation
Type-check every built package entry point without skipping Arc declaration diagnostics. Keep the scenario cleanup hook in Core's emitted API and hide its source from structured logs. Refs #77
Preserve the query name and user-facing error while avoiding string matching in Chronicle's scenario adapter. Relax cancellation timing to tolerate busy CI hosts. Refs #77
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.
Arc for TypeScript 0.37.0 adds in-memory Chronicle query scenarios, the counterpart of the query scenario seeding in Arc for .NET, and aligns snapshot queries that return streams with .NET. npm publication remains disabled.
Added
ChronicleQueryScenario.for(Model, 'method', ...artifacts)runs a model-bound query against Chronicle read models without a kernel. Seed state per event source withgiven.forEventSource(id, tenant?):.events(...)builds reducer-backed read models with the Chronicle SDK'sReadModelScenario, and.readModel(instance)pins an instance, which wins over seeded events. Reads are tenant-scoped, and an unseeded key resolves as missing.ChronicleKernelScenario, and the scenario says so rather than returning a partial answer.snapshotStreamSource(result)in@cratis/arc.corereturns the stream a snapshot query returned by mistake, so a test host can release it.Changed
Subjectstays usable.QueryScenarioreleases such a stream before rejecting, with a one-second limit and cancellation support. Sources returned inside a scenario are treated as owned by the scenario and may be closed.QueryScenario.perform()now rejects queries declaredobservable: true, asQueryScenariodoes in Arc for .NET; useObservableQueryScenariofor them.yarn cinow type-checks the built declarations of every published package withskipLibCheck: false, so a declaration a consumer can't compile fails the build.Refs #77