fix: recover gateway callbacks and client send flows

This commit is contained in:
hectorzhao
2026-08-27 14:30:02 +08:00
parent a280b4bb22
commit d6edb88b76
10 changed files with 167 additions and 10 deletions
+4 -1
View File
@@ -232,9 +232,12 @@ func EventFromStreamValues(values map[string]interface{}) (Event, error) {
if err := json.Unmarshal([]byte(data), &event); err != nil {
return Event{}, err
}
if event.SchemaVersion != queue.SchemaVersion || event.EventID == "" || event.MessageID == "" {
if event.SchemaVersion != queue.SchemaVersion || event.EventID == "" || event.ChannelID == "" {
return Event{}, fmt.Errorf("invalid result Outbox envelope")
}
if (event.EventType == "submit_result" || event.EventType == "submit_segment_result") && event.MessageID == "" {
return Event{}, fmt.Errorf("submit result Outbox messageId is required")
}
if event.Path != "/gateway/events/submit-result" && event.Path != "/gateway/events/submit-segment-result" && event.Path != "/gateway/events/receipt/intake" && event.Path != "/gateway/events/uplink" && event.Path != "/gateway/events/dead-letter" {
return Event{}, fmt.Errorf("unsupported result Outbox path %q", event.Path)
}