feat: fence command acceptance by session
This commit is contained in:
@@ -229,6 +229,18 @@ func (server *AgentServer) serveConnection(parent context.Context, connection *w
|
||||
server.close(connection, websocket.StatusPolicyViolation, "invalid client capacity")
|
||||
return
|
||||
}
|
||||
continue
|
||||
}
|
||||
if acknowledgement := envelope.GetCommandAccepted(); acknowledgement != nil {
|
||||
issue, parseErr := domain.ParseUUIDv7(acknowledgement.GetIssueUuid())
|
||||
if parseErr != nil {
|
||||
server.close(connection, websocket.StatusPolicyViolation, "invalid command acceptance")
|
||||
return
|
||||
}
|
||||
if _, acceptErr := server.Store.RecordCommandAcceptance(sessionContext, issue, hello.GetClientId(), registration.Generation, acknowledgement.GetCommandRevision(), acknowledgement.GetAccepted(), server.now()); acceptErr != nil {
|
||||
server.close(connection, websocket.StatusPolicyViolation, "invalid command acceptance")
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user