Removed reply and error for general response.
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s

This commit is contained in:
Jeff Baskin 2025-08-22 13:12:54 -04:00
parent dce8434fb0
commit a0ceacdd4f

View File

@ -227,22 +227,6 @@ impl Message {
action: action.into(),
}
}
fn reply(&self, resp: Reply) -> Self {
Self {
msg_id: self.msg_id.clone(),
document_id: self.document_id.clone(),
action: MsgAction::Reply(resp),
}
}
fn error(&self, err: MTTError) -> Self {
Self {
msg_id: self.msg_id.clone(),
document_id: self.document_id.clone(),
action: MsgAction::Error(err),
}
}
}
#[cfg(test)]
@ -311,7 +295,7 @@ mod messages {
let name = "testing";
let msg = Message::new(name, MsgAction::Query(Query::new()));
let responce = Reply::new();
let reply = msg.reply(responce);
let reply = msg.response(responce);
assert_eq!(reply.get_message_id(), msg.get_message_id());
match reply.get_document_id() {
NameID::Name(data) => assert_eq!(data, name),
@ -328,7 +312,7 @@ mod messages {
let name = "testing";
let msg = Message::new(name, MsgAction::Query(Query::new()));
let err_msg = Uuid::new_v4().to_string();
let result = msg.error(MTTError::DocumentNotFound(err_msg.clone()));
let result = msg.response(MTTError::DocumentNotFound(err_msg.clone()));
assert_eq!(result.get_message_id(), msg.get_message_id());
match result.get_document_id() {
@ -1633,7 +1617,7 @@ impl DocumentFile {
match queue.register(tx, name, routes) {
Ok(_) => {}
Err(err) => {
let error = msg.error(err);
let error = msg.response(err);
queue.send(error).unwrap();
return;
}
@ -1647,7 +1631,7 @@ impl DocumentFile {
spawn(move || {
doc.listen();
});
let reply = msg.reply(Reply::new());
let reply = msg.response(Reply::new());
queue.send(reply).unwrap();
}