A report the store cannot take yet is handed back to the broker, not acknowledged and lost (novox/hq issue 082)

This commit is contained in:
2026-09-22 13:25:13 +02:00
parent ff26ea959d
commit 047830a6b5
5 changed files with 157 additions and 1 deletions
+8 -1
View File
@@ -144,7 +144,14 @@ var ErrNoBrokerManagement = errors.New("no broker management configured")
// A node states; the owning context writes (novox/hq ADR 0006). What a node says it applied is
// its own account of its own machine, kept as a copy for recovery — so this writes it down and
// decides nothing from it.
func (e Enrolment) Heard(ctx context.Context, report Report) error {
func (e Enrolment) Heard(ctx context.Context, report Report) (err error) {
// A store that could not be asked right now is said as such, so the report is kept for
// another attempt rather than acknowledged and lost (novox/hq issue 082).
defer func() {
if inventory.Unreachable(err) {
err = fmt.Errorf("%w: %w", ErrTryAgain, err)
}
}()
if report.Node == "" {
return errors.New("a report named no node")
}