revoltchat / revolt.js

Modern Typescript library for interacting with Revolt.
https://revolt.js.org
MIT License
216 stars 54 forks source link

bug: update events don't use hydration key mappings #82

Closed sussycatgirl closed 1 year ago

sussycatgirl commented 1 year ago

What happened?

I believe this applies to almost all update events, but it's mainly been affecting me with channels, so I'll use those as an example.

From what I have gathered, when a ChannelUpdate event is received, revolt.js doesn't apply the key mappings. For example, when a channel's permissions are updated, the new Channel object looks like this:

rolePermissions here is the old data, role_permissions is the new data.

The result is that all data that revolt.js provides under a different key than what the API returns will not be updated and keep its initial value until the client reconnects.