[Add] Replyjumps

This commit is contained in:
Alex Emmet 2026-08-28 16:21:11 +02:00
commit 809ebfb4fb
No known key found for this signature in database
3 changed files with 7 additions and 7 deletions

@ -1 +1 @@
Subproject commit 486541b9483356ff49ff3ec7016f87d3ecbeaa0e Subproject commit f3c5037b0a099ae5389486eec77471bd5addab4a

View file

@ -394,9 +394,7 @@ impl OmikronConnection {
let request_id = value.id(); let request_id = value.id();
let result = crate::transport::relay_router::route_from_omikron(id, value).await; let result = crate::transport::relay_router::route_from_omikron(id, value).await;
let response = match &result { let response = match &result {
Ok(()) => request_id.map(|request_id| { Ok(response) => request_id.map(|request_id| response.clone().with_id(request_id)),
CommunicationValue::new(CommunicationType::Success).with_id(request_id)
}),
Err(error) => { Err(error) => {
log_err!(id, PrintType::Omega, "Relay routing failed: {}", error); log_err!(id, PrintType::Omega, "Relay routing failed: {}", error);
request_id.map(|request_id| { request_id.map(|request_id| {
@ -417,7 +415,9 @@ impl OmikronConnection {
send_error send_error
); );
} }
return result.map_err(|error| crate::error::OmegaError::Transport(error.to_string())); return result
.map(|_| ())
.map_err(|error| crate::error::OmegaError::Transport(error.to_string()));
} }
match value.get_comm_type_enum() { match value.get_comm_type_enum() {
Some(CommunicationType::ShortenLink) => { Some(CommunicationType::ShortenLink) => {

View file

@ -82,7 +82,7 @@ pub fn error_response_type(error: &RelayRouteError) -> CommunicationType {
pub async fn route_from_omikron( pub async fn route_from_omikron(
source_omikron_id: i64, source_omikron_id: i64,
frame: CommunicationValue, frame: CommunicationValue,
) -> Result<(), RelayRouteError> { ) -> Result<CommunicationValue, RelayRouteError> {
let frame = ensure_relay_frame_id(frame); let frame = ensure_relay_frame_id(frame);
if !frame.is_type(CommunicationType::Relay) { if !frame.is_type(CommunicationType::Relay) {
return Err(RelayRouteError::Relay(RelayError::NotRelay)); return Err(RelayRouteError::Relay(RelayError::NotRelay));
@ -154,7 +154,7 @@ pub async fn route_from_omikron(
RelayRouteError::Send(error.to_string()) RelayRouteError::Send(error.to_string())
})?; })?;
if response.is_type(CommunicationType::Success) { if response.is_type(CommunicationType::Success) {
Ok(()) Ok(response)
} else { } else {
Err(RelayRouteError::Send(format!( Err(RelayRouteError::Send(format!(
"destination Omikron rejected the Relay with {}", "destination Omikron rejected the Relay with {}",