feat: apply lifecycle events atomically

This commit is contained in:
2026-09-06 09:39:41 +00:00
parent 214d4e43d2
commit ebbbcb6aff
3 changed files with 46 additions and 6 deletions
+4
View File
@@ -275,6 +275,10 @@ func eventAppendFromWire(event *rvboxv1.CommandEvent, clientID string, generatio
var immutable [32]byte
copy(immutable[:], event.GetImmutableEventSha256())
result := store.EventAppend{IssueUUID: [16]byte(issue), ClientID: clientID, SessionGeneration: generation, EventSeq: event.GetEventSeq(), ObservedUnixNano: event.GetObservedAt().AsTime().UnixNano(), ReceiptUnixNano: receipt.UnixNano(), EventType: eventType(event), Compression: 1, RawLength: uint64(len(payload)), Payload: payload, ImmutableSHA256: immutable}
if lifecycle := event.GetLifecycle(); lifecycle != nil {
value := lifecycle.GetLifecycle()
result.Lifecycle, result.LifecycleRevision = &value, lifecycle.GetCommandRevision()
}
if output := event.GetOutput(); output != nil {
result.Stream = uint16(output.GetStream())
result.Output = true