Repository navigation
Policy fromNowOn: the head recorded as read, nothing as handled - #180
Merged
Merged
Conversation
A policy starting from now on placed its first bookmark at the head with the handled reference alone. The projector takes a missing read position to be the handled reference, so an idle run reading to that same head saw nothing moved and never wrote one: the bookmark showed an event processed but none read until something was appended to the stream. The head is now recorded as both positions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CbFecBFD17EgzYnoszEgfX
A policy starting from now on now records the head of the stream as its read position only, so its bookmark's handled reference is only ever an event the policy really handled - what an operator reads it as. While nothing has been handled, its processor resumes after that read position (the eventstore resumes such a bookmark from the beginning, which would replay the history the policy was deployed to skip), reading through ReadPositionStartSource, which keeps the projector from recording that start point as handled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CbFecBFD17EgzYnoszEgfX
…re projector The framework now builds on eventstore 0.12.0-SNAPSHOT and its Projector.Builder.resumeAfterReadPosition(), which replaces ReadPositionStartSource: a fromNowOn policy records the head as read only, and while it has handled nothing its projector resumes after that read position, the handled reference staying empty until it handles an event. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CbFecBFD17EgzYnoszEgfX
…terReadPosition Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CbFecBFD17EgzYnoszEgfX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A policy registered
fromNowOn()places its first bookmark at the head of the domain stream when it first leads. That bookmark named the head as the last handled event, with no read position. On the dashboard this showed aslastProcessedset andlastSeenempty (seen on the modeler'sRevokeAgentKeysOfRevokedAccountPolicy).That is wrong in two ways:
Change
fromNowOn()policy deployed for the first time records the head withplaceReadPosition(head): read up to here, nothing handled.resumeAfterReadPosition(). Normally, a bookmark with no handled event resumes from the beginning, which would replay the history the policy was deployed to skip. The handled reference stays empty until the policy really handles an event.0.11.4, the release carryingresumeAfterReadPosition().ReadPositionStartSource, now removed).Tests
PolicyModuleTest:The full framework build passes on the in-memory and in-memory-fs backends, against eventstore 0.11.4 resolved from Maven Central. PostgreSQL was not run, because Docker is not available here.
🤖 Generated with Claude Code
https://claude.ai/code/session_01CbFecBFD17EgzYnoszEgfX