The link knows a superseded report (issue 031)

This commit is contained in:
2026-09-21 12:11:52 +02:00
parent 153990348c
commit 1ab0364705
2 changed files with 9 additions and 0 deletions
+4
View File
@@ -7,6 +7,7 @@ import (
"encoding/base64"
"errors"
"fmt"
"log"
"sort"
"github.com/novox/mesh-controller/internal/broker"
@@ -161,6 +162,9 @@ func (e Enrolment) Heard(ctx context.Context, report Report) error {
// this with only a node name; a real report always carries an account (something applied, or
// a refusal, or a failure), so those are the reports that get written down.
if report.Applied == nil && report.Refused == "" && len(report.Failed) == 0 {
if report.Superseded != "" {
log.Printf("%s set aside declaration %s for the newer %s", report.Node, report.Declared, report.Superseded)
}
return e.Inventory.Seen(ctx, node.ID)
}
// What it did is kept whichever way it went. Until this, a refusal or a failure moved