Skip to content

Validate native tenant store isolation #265

Closed

Description

@thomhurst

Validate and document the blocker-independent native store selection portion of #38. Native-first inspection found that application-owned scoped AddDbContext factories and PostgreSqlOutbox.BeginTransactionAsync(NpgsqlDataSource/Connection) already select the transaction store. A library-owned resolver facade would duplicate those native configuration paths; record that decision rather than add a parallel API.

Scope:

  • Exercise application-owned scoped store selection for manually initiated EF Core outbox units, with native Npgsql data sources and Relayer schema options.
  • Exercise explicitly composed per-tenant EF Core consumer pipelines for isolated inbox/outbox transactions. These pipelines have a tenant known at composition; do not imply dynamic incoming-tenant selection works.
  • Cover database-per-tenant and schema-per-tenant layouts without dynamic EF models or replacing native connection/pool configuration.
  • Document native object ownership, authorization before resolving database services, unknown/missing tenant rejection, rollback, and the current dynamic-consumer limitation.

Acceptance criteria:

  • Real PostgreSQL tests with several tenant databases and schemas prove business rows, overlapping inbox message IDs, outbox rows and rollback remain isolated.
  • Concurrent application scopes resolve their selected native store independently; missing/unknown tenant selection never falls back to another store.
  • Disposing application scopes/providers does not dispose application-owned shared Npgsql data sources.
  • Website call sites use the actual existing APIs and identify application-owned selection types explicitly. Update the design/decision record to explain native factory reuse.

Dynamic TenantContext-to-database binding, removal of the consumer's startup tenant assumption, and automatic durable tenant/header consistency remain acceptance criteria of parent #38 after #264. Bounded dynamic dispatch remains #266. This issue can merge independently of #264; it does not mark multi-tenancy complete.

Activity

  1. added
    phase-2: outbox
    area: outbox
    P3
    on Nov 2, 2026
  2. added
    in-progress
    on Nov 2, 2026
  3. thomhurst commented on Nov 2, 2026

    @thomhurst
    OwnerAuthor

    Native-first inspection found an independently mergeable part of #38: manual scoped selection can reuse native AddDbContext factories and PostgreSqlOutbox transaction overloads. The body now scopes this issue to real multi-database/schema isolation tests and supported call sites, so its dependency on #264 is removed and it is claimed now. Dynamic incoming-tenant consumer binding and durable tenant/header validation remain explicit parent acceptance criteria: the current EF consumer resolves TContext in a startup scope before a delivery tenant exists. No default tenant or parallel transaction/resolver API will mask that limitation.

  4. changed the title [-]Resolve tenant outbox and inbox transaction stores[/-] [+]Validate native tenant store isolation[/+] on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3area: outboxin-progressphase-2: outbox

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions