fix(hub): pad short monitor IDs to the schema minimum (#2454)

This commit is contained in:
user01010111
2026-09-29 12:48:57 +13:00
committed by GitHub
parent 8b38db1ba0
commit 5df0a256c6
2 changed files with 68 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
package hub
import (
"fmt"
"strconv"
"time"
@@ -21,7 +22,8 @@ func generateMonitorID(systemId string, config monitor.Config) string {
if config.Protocol == "dns" {
args = append(args, config.Server)
}
return systems.MakeStableHashId(args...)
// Meet the record ID minimum without changing existing IDs of six or more characters.
return fmt.Sprintf("%06s", systems.MakeStableHashId(args...))
}
// bindNetworkMonitorsEvents keeps monitor records and agent monitor state in sync.