Skip to content

Failing Test for GH-678 - #679

Merged
jeremydmiller merged 1 commit into
JasperFx:masterfrom
ericgreenmix:master
Feb 20, 2017
Merged

Failing Test for GH-678#679
jeremydmiller merged 1 commit into
JasperFx:masterfrom
ericgreenmix:master

Conversation

@ericgreenmix

Copy link
Copy Markdown
Contributor

No description provided.

@jeremydmiller

Copy link
Copy Markdown
Member

@ericgreenmix On it now.

@jeremydmiller
jeremydmiller merged commit 66d1556 into JasperFx:master Feb 20, 2017
@jeremydmiller jeremydmiller modified the milestone: 1.4 Feb 20, 2017
jeremydmiller added a commit that referenced this pull request Aug 18, 2026
Bumps the JasperFx line to 2.52.0 and adopts IDocumentCommitListener /
IDocumentChangeSet / IDocumentDeletion, the store-agnostic post-commit
SESSION hook, so a listener written once works on Marten, Polecat and
Fisher alike.

Adopted as an ADAPTER rather than by widening Marten's own types, and that
is forced by the compiler rather than chosen:

  * IChangeSet.Inserted/Updated are IEnumerable<object>, which does not
    satisfy the contract's IReadOnlyList<object>
  * IChangeSet.Deleted is IEnumerable<Weasel.Storage.IDeletion>, which
    does not satisfy IReadOnlyList<IDocumentDeletion>
  * DocumentSessionListenerBase.AfterCommitAsync differs from the
    contract's signature in three of its four positions

Putting IDocumentChangeSet on IChangeSet would therefore be a breaking
change to every existing Marten listener, and putting it on
ISessionWorkTracker would additionally rope in ProjectionUpdateBatch,
whose Inserted/Updated/Deleted all throw NotSupportedException.

MartenDocumentChangeSet materialises the three collections in its
constructor. That is load-bearing, not defensive: Marten's IChangeSet IS
the session's live UnitOfWork, its members are lazy LINQ chains over
_operations, and SaveChangesAsync resets it immediately after the listener
loop. Proven by a negative control -- a lazy forward fails four of the ten
compliance facts.

Registration mirrors IInitialData exactly. AddMarten() sweeps
IDocumentCommitListener out of the container onto the MAIN store only;
ancillary stores opt in with
ConfigureMarten<T>(opts => opts.AddCommitListener(listener)). A bare sweep
cannot tell which store a registration was meant for, so applying it to
every AddMartenStore<T> would attach every listener to every store with no
way to opt one out.

Pinned by DocumentCommitListenerCompliance (10/10) plus five Marten-side
DI facts, which cover what the compliance fixture structurally cannot: it
builds a bare StoreOptions with no container, so the AddMarten sweep is
exercised by nothing over there.


Claude-Session: https://claude.ai/code/session_011mpctjngqnraWVnDaqWtYf

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

2 participants