DLV-G1, DLV-W1: the grants part and the watchman hear mesh-broker's events on the seat's subject; the keeper is granted them
The lead's ruling of 13:0x (registry milestone): mesh-broker's events are mesh.seat.mesh-broker.event.<event> on the shared events stream like every seat's. The grants part and the watchman consume mesh-broker.<event> and no longer hear the bus module's own stream, which is its history for its tool. The keeper's process account is composed the seat's event subjects, and the acknowledgement of a snapshot's chunks of each entry it keeps, which ADR 0626 §1 grants and the composition lacked; a row holds it to no subscription of a restricted stream's subjects and no consumer of one. Claude-Session: https://claude.ai/code/session_01JG73KJNrH5EgFXMKKYSrig
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"slices"
|
||||
"strings"
|
||||
"sync/atomic"
|
||||
"testing"
|
||||
@@ -231,19 +232,16 @@ func TestTheGrantsPartWhole(t *testing.T) {
|
||||
if firstViewAsks.Load() < int32(len(grants.FirstViews)) {
|
||||
t.Errorf("the part composed with %d first-view asks, want one of each of the %d", firstViewAsks.Load(), len(grants.FirstViews))
|
||||
}
|
||||
// DLV-G1, 1966/AC34 (novox/hq ADR 0595 §1, §7): the bus module's created, said on its own stream, reaches the part on
|
||||
// its durable consumer there, and the binding it carries is in the module's membership; dropped takes it out.
|
||||
until("the part's durable consumer on the bus module's stream", func() bool {
|
||||
e, err := kvs[grants.Module+"."+grants.StateMemberships].Get(ctx, "a."+grants.Module)
|
||||
// DLV-G1, 1966/AC34 (novox/hq ADR 0595 §1, §7): the bus module's created, said on the seat mesh-broker's subject on
|
||||
// EVENTS like every seat's event (the lead's ruling, registry milestone 13:0x), reaches the part on its durable consumer
|
||||
// there, and the binding it carries is in the module's membership; dropped takes it out.
|
||||
until("the part's durable consumer on EVENTS hearing mesh-broker's created", func() bool {
|
||||
cons, err := js.Consumer(ctx, "EVENTS", "a_"+grants.Module)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
m, err := membership.DecodeGrantsMembership(e.Value())
|
||||
if err != nil || len(m.Hears) == 0 {
|
||||
return false
|
||||
}
|
||||
_, err = js.Consumer(ctx, m.Hears[0].Stream, m.Hears[0].Consumer)
|
||||
return err == nil
|
||||
info, err := cons.Info(ctx)
|
||||
return err == nil && slices.Contains(info.Config.FilterSubjects, "mesh.seat.mesh-broker.event.created")
|
||||
})
|
||||
bindingOf := func() []membership.BusBinding {
|
||||
e, err := kvs[grants.Module+"."+grants.StateMemberships].Get(ctx, "a.mod-c")
|
||||
@@ -255,7 +253,7 @@ func TestTheGrantsPartWhole(t *testing.T) {
|
||||
}
|
||||
sayBroker := func(event string, bind membership.BusBinding) {
|
||||
body, _ := json.Marshal(grants.BrokerEvent{V: 1, Module: "mod-c", Local: "kept", Storage: "key-value", Template: "state", Binding: bind})
|
||||
if _, err := js.Publish(ctx, "mesh.stream.nats.event."+event, body); err != nil {
|
||||
if _, err := js.Publish(ctx, "mesh.seat.mesh-broker.event."+event, body); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user