Skip to content

Propagate JasperFxOptions.EnableAdvancedTracking to Events.EnableExtendedProgressionTracking#4741

Merged
jeremydmiller merged 1 commit into
masterfrom
feature/enable-advanced-tracking-extended-progression
Jun 14, 2026
Merged

Propagate JasperFxOptions.EnableAdvancedTracking to Events.EnableExtendedProgressionTracking#4741
jeremydmiller merged 1 commit into
masterfrom
feature/enable-advanced-tracking-extended-progression

Conversation

@jeremydmiller

Copy link
Copy Markdown
Member

Summary

When JasperFxOptions.EnableAdvancedTracking == true is set on the container (typically via CritterWatch configuration), every Marten DocumentStore — the main one registered via AddMarten and any ancillary stores registered via AddMartenStore<T> — opts into Events.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:

  • Main store: MartenServiceCollectionExtensions.cs:230 calls options.ReadJasperFxOptions(...) inside the StoreOptions singleton factory, before the IDocumentStore factory at line 239.
  • Ancillary stores: SecondaryStoreConfig.cs:72 calls it inside BuildStoreOptions, before Build constructs the proxied store.

Adding the propagation in ReadJasperFxOptions covers both paths with a single change and satisfies the "before StoreOptions is passed into DocumentStore" sequencing requirement.

if (options.EnableAdvancedTracking)
{
    Events.EnableExtendedProgressionTracking = true;
}

The flip is one-directional: when EnableAdvancedTracking is true, we force EnableExtendedProgressionTracking on. When it's false (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 — main DocumentStore registered via AddMarten gets EnableExtendedProgressionTracking = true
  • enable_advanced_tracking_propagates_to_ancillary_document_stores — main + two ancillary stores (IFirstStore, ISecondStore) all get EnableExtendedProgressionTracking = true
  • advanced_tracking_off_leaves_extended_progression_tracking_at_default — sanity: without EnableAdvancedTracking, neither main nor ancillary stores flip the flag (per-store opt-in preserved)
  • All 16 existing tests in jasper_fx_mechanics.cs still pass (13 prior + 3 new)
  • dotnet build clean on both src/Marten and src/CoreTests (net9.0 + net10.0)

🤖 Generated with Claude Code

…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>
@jeremydmiller jeremydmiller merged commit 928b034 into master Jun 14, 2026
8 checks passed
@jeremydmiller jeremydmiller deleted the feature/enable-advanced-tracking-extended-progression branch June 14, 2026 23:46
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