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

TryFrom<EnvelopeEntity> for Envelope contains strange (and outdated?) logic #276

Open
rubdos opened this issue Jan 7, 2024 · 0 comments

Comments

@rubdos
Copy link
Member

rubdos commented Jan 7, 2024

I came across this while implementing #255

match entity.source_uuid.as_deref() {
    Some(uuid) => {
        let address = uuid.try_into()?;
        Ok(Envelope::new_with_source(entity, address))
    },
    None => Ok(Envelope::new_from_entity(entity)),
}

I'm not sure why we don't handle the address in a single new constructor.

Additionally, the initialization in new_from_entity contains this funny part:

server_guid: entity.source_uuid,

Git blame comes to me, so I did that. Not sure why.

We should probably revisit the whole logic here and adopt it anew from Android/SD's logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant