Skip to content

Deduplicate inbox registration and close inbox retention test gaps#349

Merged
Vulthil merged 1 commit into
mainfrom
refactor/inbox-registration-dedup
Jul 21, 2026
Merged

Deduplicate inbox registration and close inbox retention test gaps#349
Vulthil merged 1 commit into
mainfrom
refactor/inbox-registration-dedup

Conversation

@Vulthil

@Vulthil Vulthil commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • Hoist the duplicated retention/metrics/TimeProvider registration out of AddRelationalInbox
    and AddCosmosInbox into one internal core entry point; the store extensions now register
    only their store type. The configure delegate now runs once eagerly (for the gates) plus
    once deferred (for injected consumers), down from three invocations.
  • Remove ValidateDataAnnotations()/[Range] pairs that duplicated adjacent lambda validation
    in both the inbox and outbox option types. On the outbox side this required adding explicit
    lambda checks first for five constraints that were not actually mirrored anywhere else, to
    keep validation behavior unchanged.
  • AddInboxRetention gains ArgumentNullException.ThrowIfNull, registers TimeProvider.System, and
    makes its configure parameter optional (PublicAPI.Shipped.txt updated in place; verified via
    build and pack that this is accepted as a compatible change).
  • Add the missing inbox retention test coverage: background-service batching/cutoff behavior,
    and DI-registration-level tests (options validation, enabled/disabled hosted-service gating)
    that didn't exist for the inbox family before.
  • Hoist a per-delivery typeof(TMessage).FullName computation to a static field in
    IdempotentConsumeFilter, and make the Cosmos retention sweep treat a concurrent sweeper's
    DbUpdateConcurrencyException as progress instead of an error-level log.

Verification

  • Full solution build: clean, 0 warnings/errors.
  • Touched test projects, both target frameworks: all green (Inbox core, Inbox.Relational,
    SharedKernel.Outbox), plus downstream Outbox.EntityFrameworkCore and Messaging.Outbox suites
    re-run as a sanity check.
  • dotnet pack -c Release for every touched src project: APICompat reports no breaking changes
    against the 1.1.0 baseline for all four packages.
  • PublicAPI files are unchanged except the one documented optional-parameter text edit.

Backport to v1.0: no — internal dedup and tests ship with the next release.

@Vulthil
Vulthil merged commit 8c72721 into main Jul 21, 2026
7 checks passed
@Vulthil
Vulthil deleted the refactor/inbox-registration-dedup branch July 21, 2026 19:14
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