Propagate JasperFxOptions.EnableAdvancedTracking to Events.EnableExtendedProgressionTracking#4741
Merged
jeremydmiller merged 1 commit intoJun 14, 2026
Conversation
…ndedProgressionTracking When the JasperFx host opts into advanced tracking (typically via CritterWatch configuration), every Marten DocumentStore in the container — main and ancillary — should expose the richer per-shard progression state. The single integration point is StoreOptions.ReadJasperFxOptions, called by both MartenServiceCollectionExtensions (main store) and SecondaryStoreConfig (ancillary stores) before the IDocumentStore singleton is constructed. Tests cover main store, ancillary stores (IFirstStore + ISecondStore), and the off-case to confirm per-store opt-in is preserved when EnableAdvancedTracking is unset. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 tasks
This was referenced Jun 15, 2026
Merged
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.
Summary
When
JasperFxOptions.EnableAdvancedTracking == trueis set on the container (typically via CritterWatch configuration), every MartenDocumentStore— the main one registered viaAddMartenand any ancillary stores registered viaAddMartenStore<T>— opts intoEvents.EnableExtendedProgressionTracking. Downstream tools (CritterWatch in particular) then see the richer per-shard progression state.Implementation
The single integration point is
StoreOptions.ReadJasperFxOptions(src/Marten/StoreOptions.cs:312). Both call sites already wire through it:MartenServiceCollectionExtensions.cs:230callsoptions.ReadJasperFxOptions(...)inside theStoreOptionssingleton factory, before theIDocumentStorefactory at line 239.SecondaryStoreConfig.cs:72calls it insideBuildStoreOptions, beforeBuildconstructs the proxied store.Adding the propagation in
ReadJasperFxOptionscovers both paths with a single change and satisfies the "beforeStoreOptionsis passed intoDocumentStore" sequencing requirement.The flip is one-directional: when
EnableAdvancedTrackingistrue, we forceEnableExtendedProgressionTrackingon. When it'sfalse(default), the per-store value is untouched and per-store opt-in semantics are preserved.Test plan
Three tests added to
CoreTests/jasper_fx_mechanics.cs:enable_advanced_tracking_propagates_to_main_document_store— mainDocumentStoreregistered viaAddMartengetsEnableExtendedProgressionTracking = trueenable_advanced_tracking_propagates_to_ancillary_document_stores— main + two ancillary stores (IFirstStore,ISecondStore) all getEnableExtendedProgressionTracking = trueadvanced_tracking_off_leaves_extended_progression_tracking_at_default— sanity: withoutEnableAdvancedTracking, neither main nor ancillary stores flip the flag (per-store opt-in preserved)jasper_fx_mechanics.csstill pass (13 prior + 3 new)dotnet buildclean on bothsrc/Martenandsrc/CoreTests(net9.0 + net10.0)🤖 Generated with Claude Code