fix: make the runtime store authoritative for the announcement

Always reflect the stored announcement in config.json: expose it while live
and clear it otherwise. A disabled announcement now clears the config output
instead of falling back to a statically configured one, which removes the
precedence ambiguity raised in review.
This commit is contained in:
Dominik Schmidt
2026-07-29 08:18:56 +02:00
parent 51dd107767
commit 046f46ce8d

View File

@@ -156,11 +156,9 @@ func (p Web) getPayload() (payload []byte, err error) {
// ensure that the server url has a trailing slash
webConfig.Server = strings.TrimRight(webConfig.Server, "/") + "/"
// inject the runtime managed announcement banner; keep a statically configured one
// (web.config.options.announcement) when nothing is stored
if a := p.currentAnnouncement(); a != nil {
webConfig.Options.Announcement = a
}
// the runtime store is authoritative for the announcement banner: expose it when live,
// clear it otherwise
webConfig.Options.Announcement = p.currentAnnouncement()
return json.Marshal(webConfig)
}