fix(adapter): stabilize callback event ordering

This commit is contained in:
Your Name
2026-05-06 11:02:41 +08:00
parent 16e53361f2
commit dbf88bea07

View File

@@ -34,7 +34,7 @@ func BuildInboundEvents(msg *message.UnifiedMessage, result *dialog.Result, meta
}
eventIndex := 0
baseEvent := func(eventType string, payload map[string]any) platformevent.Event {
eventTime := now.Add(time.Duration(eventIndex) * time.Nanosecond)
eventTime := now.Add(time.Duration(eventIndex) * time.Millisecond)
eventIndex++
return platformevent.Event{
ID: uuid.New().String(),
@@ -47,7 +47,7 @@ func BuildInboundEvents(msg *message.UnifiedMessage, result *dialog.Result, meta
Payload: payload,
Status: platformevent.StatusPending,
AttemptCount: 0,
NextAttemptAt: eventTime,
NextAttemptAt: now,
OccurredAt: eventTime,
CreatedAt: eventTime,
UpdatedAt: eventTime,