Goal
Add a read-only query method on JasperFx.Events.IEventDatabase so monitoring tools can read the current progression-row state for a single (projectionName, tenantId?) cell without spinning up an IProjectionDaemon.
public interface IEventDatabase
{
// … existing methods …
/// <summary>
/// Read the current sequence + lifecycle state for a single (projection,
/// tenant) cell directly from the progression table, without spinning the
/// projection daemon. Returns null when no row exists for the (projection,
/// tenant) pair yet (e.g. projection hasn't been observed by the daemon
/// for this tenant). Tenant id null means store-global on non-tenanted
/// stores or the default-tenant row on tenanted stores.
/// </summary>
ValueTask<ProjectionProgressRow?> ReadProjectionProgressAsync(
string projectionName,
string? tenantId,
CancellationToken token);
}
public record ProjectionProgressRow(
string ProjectionName,
string? TenantId,
long Sequence,
string AgentStatus,
DateTimeOffset? LastHeartbeat);
Why
CritterWatch#309 — the long-running projection rebuild orchestration feature — wants finer-grained UI progress per cell during a rebuild. The dispatcher loop itself works without this (RestartProjectionResult covers terminal state); this is purely for the in-flight sparkline / current-sequence rendering on the Rebuilds page.
The existing IEventDatabase.AllProjectionProgress works but returns every row across every projection × tenant pair, which the BFF then has to filter. For a per-cell UI polling loop (e.g. 1Hz against a single visible batch), the targeted query is materially cheaper.
Priority
v1.1 candidate, not v1. CritterWatch#309's design explicitly notes that the existing EventProgressionPoller + RestartProjectionResult carry enough state for the dispatch loop. This query method matters only for the finer UI grain — punt if it slows other work down.
Companion PRs
jasperfx/marten — implement the query against mt_event_progression.
jasperfx/polecat — same for pc_event_progression.
Both follow once this lands and only once CritterWatch#309's v1 dispatcher demonstrates a clear need for it.
Goal
Add a read-only query method on
JasperFx.Events.IEventDatabaseso monitoring tools can read the current progression-row state for a single(projectionName, tenantId?)cell without spinning up anIProjectionDaemon.Why
CritterWatch#309 — the long-running projection rebuild orchestration feature — wants finer-grained UI progress per cell during a rebuild. The dispatcher loop itself works without this (
RestartProjectionResultcovers terminal state); this is purely for the in-flight sparkline / current-sequence rendering on the Rebuilds page.The existing
IEventDatabase.AllProjectionProgressworks but returns every row across every projection × tenant pair, which the BFF then has to filter. For a per-cell UI polling loop (e.g. 1Hz against a single visible batch), the targeted query is materially cheaper.Priority
v1.1 candidate, not v1. CritterWatch#309's design explicitly notes that the existing
EventProgressionPoller+RestartProjectionResultcarry enough state for the dispatch loop. This query method matters only for the finer UI grain — punt if it slows other work down.Companion PRs
jasperfx/marten— implement the query againstmt_event_progression.jasperfx/polecat— same forpc_event_progression.Both follow once this lands and only once CritterWatch#309's v1 dispatcher demonstrates a clear need for it.