feat: add empty client spool reconciliation
This commit is contained in:
@@ -184,6 +184,22 @@ func (server *AgentServer) serveConnection(parent context.Context, connection *w
|
||||
server.close(connection, websocket.StatusPolicyViolation, ErrStaleSession.Error())
|
||||
return
|
||||
}
|
||||
if snapshot := envelope.GetReconcileSnapshot(); snapshot != nil {
|
||||
// A retained command requires the command-store reconciliation phase,
|
||||
// which is deliberately not substituted with a no-op result.
|
||||
if len(snapshot.GetRetainedCommands()) != 0 {
|
||||
server.close(connection, websocket.StatusPolicyViolation, "reconciliation for retained commands is unavailable")
|
||||
return
|
||||
}
|
||||
encoded, err := proto.Marshal(&rvboxv1.AgentEnvelope{
|
||||
SessionId: encodedSessionID, SessionGeneration: registration.Generation,
|
||||
Payload: &rvboxv1.AgentEnvelope_ReconcileResult{ReconcileResult: &rvboxv1.ReconcileResult{}},
|
||||
})
|
||||
if err != nil || queue.EnqueueControl(Frame{Kind: FrameControl, Payload: encoded}) != nil {
|
||||
server.close(connection, websocket.StatusInternalError, "could not queue reconciliation result")
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user