Reference: https://github.com/omegaup/quark/blob/main/cmd/omegaup-broadcaster/main.go#L293-L296
π Issue Description
Currently, the detection of /run/update/ messages relies on string matching:
strings.Contains(message.Message, "\"message\":\"/run/update/\"")
Suggested Improvement
Parse the JSON payload and check the message field explicitly:
type payload struct {
Message string `json:"message"`
}
var p payload
if err := json.Unmarshal([]byte(message.Message), &p); err == nil {
if len(message.Contest) > 0 && strings.HasPrefix(p.Message, "/run/update/") {
contestChan <- message.Contest
}
}
Reference: https://github.com/omegaup/quark/blob/main/cmd/omegaup-broadcaster/main.go#L293-L296
π Issue Description
Currently, the detection of
/run/update/messages relies on string matching:Suggested Improvement
Parse the JSON payload and check the
messagefield explicitly: