From a94b275a9c74366799b0c54f93764c9dfaf29792 Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 20 Nov 2026 05:24:20 +0100 Subject: [PATCH] I-114 fix: a state held not there yet holds nothing to take in first Before the state held is bound, hearing a source-moved read it to hold the event behind earlier ones, failed and left every message unacknowledged, so nothing was taken in (two of the indexer's integration tests, which make no held state). A state not there yet holds nothing: the event is taken in; holding it still needs the state. Builds: design 47 H H-A-114, H-A-118 Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy --- modules/mesh-delivery-indexer/internal/index/held.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/mesh-delivery-indexer/internal/index/held.go b/modules/mesh-delivery-indexer/internal/index/held.go index ab9fae0d..c947f68e 100644 --- a/modules/mesh-delivery-indexer/internal/index/held.go +++ b/modules/mesh-delivery-indexer/internal/index/held.go @@ -14,6 +14,7 @@ import ( "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-indexer/takein" stdio "git.novox.be/novox/mesh-sdk/go" "git.novox.be/novox/mesh-sdk/go/keys" + "git.novox.be/novox/mesh-sdk/go/process" ) // HeldState is the indexer's state held (design 47 H ยง744, H-A-97, H-A-118): one key per watched branch, the branch escaped as @@ -123,6 +124,9 @@ func (ix *Indexer) hold(ctx context.Context, e meshdelivery.SourceMovedEvent, wh // taken in in their order (H-A-118); it answers whether it did. ErrHeldUnwritten when it is not written. func (ix *Indexer) HoldBehind(ctx context.Context, e meshdelivery.SourceMovedEvent) (bool, error) { hs, err := ix.HeldOf(ctx, e.Branch) + if errors.Is(err, process.ErrNotYet) { + return false, nil // a state held not there yet holds nothing to take in first + } if err != nil { return false, fmt.Errorf("%w: %v", ErrHeldUnwritten, err) }