H1 integration bound: the repairs' refresh keeps the tools it still serves

When a module's ledger binding came or went, refreshRepairs stopped every
subscription of its tools and served them all again, so a call in that
gap was dropped the same way as on a membership (H-A-158). serve is now
the one routine that changes a module's subscriptions, by tool address:
it keeps those still named, subscribes the new, then stops those no
longer named; refreshRepairs and the first serve both go through it, so
no tool is served twice or not at all.

The ledger test's later binding now comes and goes ten times, and the
module's own tool must answer the first call after each, within the
tests' 2 s bound; it failed without the change at GOMAXPROCS=1 and 24.

Builds: design 47 H §774, H-A-158, H-A-160; principle 11
This commit is contained in:
2026-11-20 17:28:34 +01:00
parent 3850eb8eac
commit 05deea5952
2 changed files with 51 additions and 21 deletions
@@ -67,6 +67,18 @@ func TestTheLedgerRepairsAreToolsOfEveryLedgerOwner(t *testing.T) {
})
}
t.Run("a ledger bound later brings them", func(t *testing.T) {
// Its own tool answers the first call after each binding comes or goes: the repairs' refresh keeps the
// subscriptions it still names (design 47 H, H-A-160).
for round := 1; round <= 10; round++ {
plain.Bindings = nil
if round%2 == 1 {
plain.Bindings = owner.Bindings
}
mesh.Issue(t, plain)
if _, err := asker.AskWithin("plain.who@anchor", map[string]any{}, "", callWithin); err != nil {
t.Fatalf("binding change %d: the first call of plain.who failed: %v — dropped while its tools were served again", round, err)
}
}
plain.Bindings = owner.Bindings
mesh.Issue(t, plain)
mt.Until(t, func() error {