Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forward message is missing attachment id #102

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/protocols/routing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ fn generate_message_id() -> String {
Uuid::new_v4().to_string()
}

fn generate_attachment_id() -> String {
Uuid::new_v4().to_string()
}

fn build_forward_message(
forwarded_msg: &str,
next: &str,
Expand All @@ -147,6 +151,7 @@ fn build_forward_message(
serde_json::from_str(forwarded_msg)
.kind(ErrorKind::Malformed, "Unable deserialize forwarded message")?,
)
.id(generate_attachment_id())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use the function above generate_message_id, maybe we could rename it? I do not like having two functions which have exactly the same body.

.finalize();

let mut msg_builder = Message::build(generate_message_id(), FORWARD_MSG_TYPE.to_owned(), body);
Expand Down