B1 follow-up: the builder's catalog wiring passes AdoptEvent on, so catalog-revision is registered before the hub's Start

Builds: design 47 H2b §836 3., H-A-854, H-A-861
This commit is contained in:
2026-11-27 03:20:57 +01:00
parent 4eae3d6847
commit bfefd71b4c
@@ -178,6 +178,19 @@ func (w sweepWiring) Adopt(f *views.Follower, seatName, event string, hear func(
return nil
}
// AdoptEvent registers a seat's event on the wrapped reader before its Start, as the branch follower asks of a wiring that has a hub
// to refuse a pattern registered after it (design 47 H2b §836 3., H-A-854): without it the first branch followed after Start
// registers catalog-revision too late.
func (w sweepWiring) AdoptEvent(seat, event string, hear func(context.Context, []byte) error) error {
ew, ok := w.Wiring.(interface {
AdoptEvent(seat, event string, hear func(context.Context, []byte) error) error
})
if !ok {
return nil
}
return ew.AdoptEvent(seat, event, hear)
}
// Follow follows a plain view through the wrapped wiring (meshcatalogclient's SeatHolders, A-298).
func (w sweepWiring) Follow(owner, state, tool string) (func() map[string]json.RawMessage, error) {
f, ok := w.Wiring.(interface {