DLV-R1: the grants part follows the verdicts on the indexer's manifest-accepted and manifest-refused at the revision each carries, not on its views family (ADR 0622 §2)
The next revision changes the verdicts' picture with no ask; one already held is passed over; an event carrying no revision, past the next, or naming no manifest above the picture asks the first view once more, said in the log. The manifest consumes the two events in place of views.verdicts. Needs mesh-sdk 3ff694e (the events' Revision) and the indexer setting it (A2b). Claude-Session: https://claude.ai/code/session_01JG73KJNrH5EgFXMKKYSrig
This commit is contained in:
@@ -36,6 +36,7 @@ import (
|
||||
"git.novox.be/novox/mesh-sdk/go/announce"
|
||||
"git.novox.be/novox/mesh-sdk/go/process"
|
||||
|
||||
"git.novox.be/novox/mesh-sdk/go/delivery"
|
||||
"git.novox.be/novox/mesh-sdk/go/views"
|
||||
|
||||
"mesh-grants/internal/grants"
|
||||
@@ -156,6 +157,17 @@ func run(ctx context.Context, getenv func(string) string, logOut io.Writer) erro
|
||||
hearViews(m)
|
||||
return
|
||||
}
|
||||
// The indexer's verdict events go to the verdicts' first view (ADR 0622 §2), which takes each at its revision.
|
||||
if event, ok := strings.CutPrefix(m.Subject(), "mesh.mod."+grants.IndexerModule+".event."); ok &&
|
||||
(event == delivery.ManifestAcceptedEvent || event == delivery.ManifestRefusedEvent) {
|
||||
if err := fv.HearVerdict(ctx, event, m.Data(), logger.Printf); err != nil {
|
||||
logger.Printf("views: %s is not a verdict event, dropped: %v", m.Subject(), err)
|
||||
_ = m.Term()
|
||||
return
|
||||
}
|
||||
_ = m.Ack()
|
||||
return
|
||||
}
|
||||
handle(m.Subject(), m.Data())
|
||||
_ = m.Ack()
|
||||
}, jetstream.ConsumeErrHandler(func(_ jetstream.ConsumeContext, err error) { logger.Printf("hearing the bus: %v", err) })); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user