EnvelopeFlow.Inbox.Stores.Postgres
0.1.0-alpha.3.1
dotnet add package EnvelopeFlow.Inbox.Stores.Postgres --version 0.1.0-alpha.3.1
NuGet\Install-Package EnvelopeFlow.Inbox.Stores.Postgres -Version 0.1.0-alpha.3.1
<PackageReference Include="EnvelopeFlow.Inbox.Stores.Postgres" Version="0.1.0-alpha.3.1" />
<PackageVersion Include="EnvelopeFlow.Inbox.Stores.Postgres" Version="0.1.0-alpha.3.1" />
<PackageReference Include="EnvelopeFlow.Inbox.Stores.Postgres" />
paket add EnvelopeFlow.Inbox.Stores.Postgres --version 0.1.0-alpha.3.1
#r "nuget: EnvelopeFlow.Inbox.Stores.Postgres, 0.1.0-alpha.3.1"
#:package EnvelopeFlow.Inbox.Stores.Postgres@0.1.0-alpha.3.1
#addin nuget:?package=EnvelopeFlow.Inbox.Stores.Postgres&version=0.1.0-alpha.3.1&prerelease
#tool nuget:?package=EnvelopeFlow.Inbox.Stores.Postgres&version=0.1.0-alpha.3.1&prerelease
EnvelopeFlow.Inbox.Stores.Postgres
Optional durable recipient notification inbox and atomic recoverable change outbox. The application owns the NpgsqlDataSource, authorization, content database, encryption and retention invocation. No provider, conversation or application user schema is required.
Constructing a store does not create or change a schema. Explicitly call InitializeAsync, or inspect/plan/apply InboxMigrations.Catalog through PostgresMigrationRunner. Component envelopeflow.inbox is at version 2, adding kind/read ordinal indexes for optional filtered pages. The initial migration checksum/history is unchanged. Use an application-selected schema/search path and permissions. There is no schedule or implicit startup migration.
Each recipient header transaction verifies the full stored RecipientBinding, locks that owner row, then captures database time. Admission, mutable state, owner sequences and optional stable outbox event commit together. Independent clients serialize capacity checks and revisions. Failed/cancelled transactions publish no partial entry, counter or hook. Reopened sources/processes retain committed state.
Optional IInboxBulkStore uses that same owner fence for 1–100 revision-bound edits. It loads the selected identities together, validates the entire batch and aggregate outbox capacity, then sends changed entries and their events in one database batch before committing owner sequences. Conflict, backpressure, cancellation or any SQL failure rolls back every edit and event. Retrying stale entry revisions changes nothing. Optional IInboxQueryStore applies kind/read/archive filters and keyset bounds in SQL; cursors bind the full query. The new indexes require no notification fingerprint or document-format change.
Owner and notification index keys are SHA-256 hashes of length-framed strict Unicode components. Exact binding and logical ID are also stored/checked, preserving long multibyte identifiers without PostgreSQL oversized index keys. Versioned JSON is validated before use; incompatible notification/event formats fail closed without claiming an event. Metadata-only mode has no copied body. The outbox contains state evidence and full ownership, without content/reference/metadata copies.
Owner headers persist admission, mutation and event sequences. Revisions never reset after tombstone removal, protecting reused logical IDs from stale-generation edits. The selected recoverable-change mode is persisted with the owner: mutation clients must agree with it, including cleanup and event claims. Changing that mode requires an explicit application migration that preserves pending events. A read-only client may inspect state without enabling hooks.
Pages use owner/ordinal range queries and a fixed admission high-water mark; they do not use offset paging. Visibility, unread, expiry, archive, tombstone and pending/completed event indexes support scoped work. Counts are derived in a repeatable-read operation, not a promised snapshot across multiple requests. Later admissions and state/expiry changes can change subsequent counts or visibility.
Per-owner capacity includes live entries and dedup tombstones. Pending-event capacity is checked before mutations when hooks are enabled; pending events are never silently discarded. Completed outbox rows remain until explicitly cleaned. Global database growth, owner count and partitioning remain application/operator responsibilities.
Cleanup accepts one trusted owner and a total batch limit of 1–1,000. Separate indexed, bounded candidate sets select expired content, archived content and due tombstones, then consume at most the requested total rows together with due completed events. Unresolved events prevent generation-tombstone removal. Expiry hides content before physical cleanup. Default TTLs are documented by InboxStoreOptions; no active unarchived entries are removed. The dedup guarantee lasts through the retained tombstone horizon; after authorized removal the ID may be reused with a fresh ordinal/revision.
Claim leases and acknowledgment deadlines use database time. Acknowledge checks owner, event ID, fence, pending status and live lease. Explicit terminal resolution records a fixed reason/timestamp with the current fence. Callback dispatch is at least once, with application-owned effect deduplication; a hook acknowledgment is not a device/client receipt.
Focused checks use an isolated PostgreSQL schema per test:
ENVELOPEFLOW_TEST_POSTGRES="$APPLICATION_TEST_CONNECTION" dotnet test tests/Inbox/EnvelopeFlow.Inbox.Tests/EnvelopeFlow.Inbox.Tests.csproj -c Release
The suite covers independent-client contracts/races, explicit checksum initialization, full-scope Unicode keys, source reopen, injected entry/event rollback, bounded retention, pending-event protection, stale fences, visibility changes, row-lock cancellation and separate worker-process kills before invocation/after invocation. Fixture SQL expires only leases/tombstone deadlines for deterministic elapsed-time checks; it does not claim wall-clock waiting was tested.
Verification: the E32 focused suite passed 31 tests against PostgreSQL 18 with zero failures/skips and isolated build artifacts. New regressions cover competing all-or-nothing edits, selected-state filters/cursor isolation, whole-batch capacity refusal, injected SQL rollback, source reopening and one event per changed entry. Independent review status is tracked in E32/T11.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- EnvelopeFlow.Inbox.Abstractions (>= 0.1.0-alpha.3.1)
- EnvelopeFlow.Stores.Migrations.Postgres (>= 0.1.0-alpha.3.1)
- Npgsql (>= 10.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-alpha.3.1 | 45 | 11/22/2026 |
| 0.1.0-alpha.2.1 | 70 | 11/9/2026 |