Skip to content

verification_request_content returns a type not suitable for serialising as JSON #5643

Description

@andybalaam

When I call OtherUserIdentity::verification_request_content I expect to get back a type I can serialize to a valid m.room.message with msgtype: m.key.verification.request, containing the correct msgtype property etc.

In fact, I get back a partial type that is missing msgtype.

Example from a wrapper method: matrix-sdk-crypto-wasm's OtherUserIdentity::verification_request_content:

    pub fn verification_request_content(
        &self,
        methods: Option<Vec<verification::VerificationMethod>>,
    ) -> Result<String, JsError> {
        let me = self.inner.clone();
        let methods = methods.map(|methods| methods.iter().map(Into::into).collect());

        Ok(serde_json::to_string(&me.verification_request_content(methods))?)
    }

This returns a string containing JSON that does not comply with the spec section linked above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions