polyphony-chat / chorus

A Rust library for interacting with multiple Polyphony- and Spacebar-Compatible instances at once.
https://crates.io/crates/chorus
Mozilla Public License 2.0
16 stars 7 forks source link

Emoji id can be null with unicode emojis #531

Open kozabrada123 opened 1 month ago

kozabrada123 commented 1 month ago

Note the following case: {"name":"👍","id":null}

The id is set to null, since the name contains a unicode emoji

This can (sometimes) cause deserialization errors:

07:40:41 [WARN] Failed to parse gateway event MESSAGE_REACTION_ADD (invalid type: null, expected snowflake string at line 1 column 716)

07:39:36 [WARN] Failed to parse gateway event READY_SUPPLEMENTAL (missing field id at line 1 column 5849)

(Here the emoji was in a user's custom status: {"name":"🤔"})

Note: fixing this requires a custom Updateable id() impl on Emoji, potentially generating a Snowflake id from the name