Skip to content

Backport: projections rebuild must skip subscriptions + Live projections (1.0 branch) #459

Description

@jeremydmiller

Backport of the 2.x/9.x projections rebuild fix (#438 / #436, marten#4711) to the JasperFx 1.0 maintenance line, for marten#4718 (Marten 8.0 consumes JasperFx.Events 1.x).

Problem

dotnet run -- projections rebuild throws when an event subscription is registered (e.g. Wolverine's PublishEventsToWolverine(...) with SubscribeFromPresent()). A subscription (SubscriptionType.Subscription) is Async, so on the 1.x line ProjectionController.ExecuteRebuilds feeds its name into TryRebuildShardsAsyncRebuildProjectionAsyncTryFindProjection, which only searches projections and throws:

No registered projection matches the name '...'

The 1.x rebuild selection (ProjectionSelection) never excluded subscriptions or Live-lifecycle projections (only the continuous run path filters via FilterForAsyncOnly).

Fix

ProjectionSelection.RebuildableSubscriptions() excludes SubscriptionType.Subscription and ProjectionLifecycle.Live; ExecuteRebuilds uses it when building the names passed to TryRebuildShardsAsync. Subscriptions still run continuously and still appear in projections list; only rebuild skips them, and an explicitly-named subscription becomes a clean no-op.

Targets the 1.0 branch. Ships in JasperFx.Events 1.36.2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions