DI registrations create separate backing stores when tracing is disabled
Los mantenedores suelen responder en 7 días
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 15/100
Línea de trabajo
The issue names StoreRegistrationTests.cs under src/Extensions/test/Eventuous.Tests.DependencyInjection and describes the affected AddEventStore, AddEventReaderWriter, AddEventReader, and AddEventWriter APIs. Start by reviewing the existing regression tests and tracing how registrations resolve shared stores with diagnostics enabled and disabled. Done means the listed host, factory, scope, and diagnostics cases pass; the issue says an implementation is already committed locally, so check whether that work is still available before starting.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Related test issue
Discovered while implementing #608 — event-store dependency injection coverage.
Problem
With EventuousDiagnostics disabled, store registration methods register implementations or factories separately for each interface. Each interface therefore gets its own singleton rather than sharing one backing instance.
A successful append through IEventWriter can be followed by StreamNotFound when the same stream is read through IEventReader. This is reproducible with the stateful InMemoryEventStore; it is not a claim that persistent providers lose stored data. Factories can also run more than once, and standalone reader/writer registrations can ignore an already registered concrete store.
Affected APIs include the generic and factory overloads of AddEventStore<T>, AddEventReaderWriter<T>, and separately composed AddEventReader<T> / AddEventWriter<T>.
Reproduction
- Disable diagnostics, preserving the previous setting for restoration afterward.
- Build a host with
services.AddEventStore<InMemoryEventStore>(). - Resolve
IEventWriterandIEventReaderfrom that host. - Append an event to a new stream through the writer.
- Read that stream through the reader.
Actual: the read throws StreamNotFound because the interfaces resolve to different stores.
Expected: all interfaces registered for the same implementation share one backing singleton. Changing tracing configuration must not change which events are visible.
Fix and acceptance criteria
- Register the concrete implementation or factory once, then resolve interface aliases from that singleton.
- Verify append/read behavior through a real host for store, combined reader/writer, and separately registered reader/writer APIs.
- Cover generic and factory overloads with tracing enabled and disabled.
- Factories are invoked once for the shared instance, and interface resolutions remain singleton across scopes.
- Standalone reader/writer registrations reuse a pre-registered concrete instance without invoking a replacement factory.
- Tests restore the process-wide diagnostics setting and cannot race with other tests that observe it.
Existing regression tests and implementation
StoreRegistrationTests.cs in src/Extensions/test/Eventuous.Tests.DependencyInjection contains:
WrittenEventsAreVisibleThroughEveryRegisteredInterfaceStandaloneRegistrationUsesTheExistingBackingStore- The tracing-disabled cases of
RepeatedRegistrationKeepsOneServiceAndOneFactory
These scenarios failed before the production fix. The complete DI project passes all 31 tests on .NET 10 after the fixes for this issue and the companion registration issue.
An implementation is already committed locally on fix/issue-608-store-registrations, commit df3dbe48. It also fixes duplicate registrations and overridden services; this draft does not imply the fix has been published or merged.
- Lenguaje dominante
- C#
- Estrellas
- 512
- Forks
- 99
- Merge medio
- 5 d 6 h
- PR fusionados (30 d)
- 5
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Eventuous/eventuous
-
MongoDB integration tests fail on newer GitHub Actions runner kernelsPosiblemente ocupada @nmummau la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Eventuous/eventuous#626 · 2 comentarios ·
Los mantenedores suelen responder en 7 días
-
`dotnet format style --verify-no-changes` fails with naming violations and unnecessary importsPosiblemente ocupada @nmummau la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
Eventuous/eventuous#624 · 1 comentario ·
Los mantenedores suelen responder en 7 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Eventuous/eventuous#627 · 1 comentario ·
Los mantenedores suelen responder en 7 días
-
SQL Server: `append_events` does not need the `@inserted` table variablePosiblemente ocupada @nmummau la tomó hace 7 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 20/100
Eventuous/eventuous#619 · 1 comentario ·
Los mantenedores suelen responder en 7 días
-
SQL Server: stream reads do one key lookup per event, and `IDX_EventsStream` duplicates `UQ_StreamIdAndStreamPosition`Posiblemente ocupada @nmummau la tomó hace 7 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 18/100
Eventuous/eventuous#618 · 1 comentario ·
Los mantenedores suelen responder en 7 días
Todos los issues de Eventuous/eventuous
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
KnifeLemon/Filee#363 ·
Los mantenedores suelen responder en 1 día
-
[CI] .trgen-ignore required for several grammars.Posiblemente ocupada @kaby76 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
antlr/grammars-v4#5073 ·
Los mantenedores suelen responder en 1 día
-
/api/oauth/introspect emits clientId and tokenType instead of RFC 7662's client_id and token_typeAbiertobug P2
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
nightscout/nocturne#2317 ·
Los mantenedores suelen responder en 1 día
-
[BUG]: Position intent set on a simple order is dropped when it becomes a bracket, OCO or OTO orderPosiblemente ocupada @RaphaelFakhri la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
alpacahq/alpaca-trade-api-csharp#903 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
joinrpg/joinrpg-net#5752 ·
Los mantenedores suelen responder en 1 día