From 173a7654ba613ec10f042838abd1b0bac7ea3462 Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 9 Nov 2026 02:27:38 +0100 Subject: [PATCH] The assigner, the indexer and the grants part tell their followers when the bus made their consumer (issue 1966, recovery) A consumer is made from now, so an event said between a first view and the consumer is never delivered; the hub says when the bus made it (EventHub.OnBound) and each follower asks again if behind (Follower.ConsumerMade). Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i --- .../cmd/mesh-delivery-assigner/views.go | 6 ++++++ .../cmd/mesh-delivery-indexer/views.go | 2 ++ modules/mesh-grants/cmd/mesh-grants/main.go | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/views.go b/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/views.go index 34179c8b..e1b6659f 100644 --- a/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/views.go +++ b/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/views.go @@ -200,6 +200,12 @@ func (iv *indexerViews) start(ctx context.Context, w *world, wake func(), settle } }) } + // The hub says when the bus made its consumer: a picture asked before then is asked again (views.Follower.ConsumerMade). + iv.hub.OnBound(func(created time.Time) { + for _, f := range all { + f.ConsumerMade(ctx, created) + } + }) // Not heard, the indexer's views family is the finding family-not-heard until it binds (ADR 0615 §5): the handler is // registered on the module's hub, which the assigner starts once every handler is. _ = notHeardWriter(iv.findings, iv.logf).Bind(process.EventsStream, "the indexer's manifests, modules and graph are the first views' alone until the assigner starts again", func() error { diff --git a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/views.go b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/views.go index cbf5a6ab..89d56bdf 100644 --- a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/views.go +++ b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/views.go @@ -166,6 +166,8 @@ func followAssignments(ctx context.Context, hub *process.EventHub, cred process. }() // The assigner's views family, on the module's one hub (the host starts it once every handler is registered); a family the // hub cannot register is the finding family-not-heard until the indexer starts again (ADR 0615 §5). + // The hub says when the bus made its consumer: a picture asked before then is asked again (views.Follower.ConsumerMade). + hub.OnBound(func(created time.Time) { f.ConsumerMade(ctx, created) }) _ = notHeardWriter(ctx, findings, logf).Bind(process.EventsStream, "the assignments is the first view's alone, asked again by hand, until the indexer starts again", func() error { return hub.Handle("mesh.mod."+index.AssignerModule+".event."+views.EventPrefix+"*", views.Hear(ctx, map[string]*views.Follower{index.AssignmentsState: f}, logf)) }) diff --git a/modules/mesh-grants/cmd/mesh-grants/main.go b/modules/mesh-grants/cmd/mesh-grants/main.go index 1867adc9..91a00b36 100644 --- a/modules/mesh-grants/cmd/mesh-grants/main.go +++ b/modules/mesh-grants/cmd/mesh-grants/main.go @@ -158,6 +158,12 @@ func run(ctx context.Context, getenv func(string) string, logOut io.Writer) erro if !registered { registered = true // An owner's views event goes to the follower of its state, which acknowledges it (firstviews.go). + // The hub says when the bus made its consumer: a picture asked before then is asked again (views.Follower.ConsumerMade). + hub.OnBound(func(created time.Time) { + for _, f := range byState { + f.ConsumerMade(ctx, created) + } + }) if err := hub.Handle(views.EventsPattern, hearViews); err != nil { return err }