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

Fix deserialisation failure of audit logs when the user ID is absent #2931

Closed
wants to merge 1 commit into from

Conversation

arqunis
Copy link
Member

@arqunis arqunis commented Aug 5, 2024

Kind of fixes #2929.

Real fix would be to account for this at the type level with Option<T>, but this change cannot be committed to current as it is a breaking change.

Kind of fixes serenity-rs#2929. Real fix would be to account for this at the type
level with `Option<T>`, but this change cannot be committed to `current`
as it is a breaking change.
@arqunis arqunis added the fix A solution to an existing bug. label Aug 5, 2024
@github-actions github-actions bot added the model Related to the `model` module. label Aug 5, 2024
@arqunis
Copy link
Member Author

arqunis commented Aug 5, 2024

Actually not as simple of a fix as I initially thought. The #[serde(default)] attribute doesn't take into account the case where the field exists, but a null was provided as its value. And the real fix is already present on next.

I'll just close this. While I could add custom deserialisation behaviour to allow the null case, it would have to be removed anyway afterwards.

@arqunis arqunis closed this Aug 5, 2024
@arqunis arqunis deleted the null_user_id branch August 5, 2024 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix A solution to an existing bug. model Related to the `model` module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Null error in audit logs.
1 participant