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: always cast PartialMessage(able) IDs to int #2406
base: master
Are you sure you want to change the base?
fix: always cast PartialMessage(able) IDs to int #2406
Conversation
@@ -3189,7 +3189,7 @@ def __init__( | |||
): | |||
self._state: ConnectionState = state | |||
self._channel: Object = Object(id=id) | |||
self.id: int = id | |||
self.id: int = int(id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not change the part where the ID is passed in with the wrong type instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose, but shouldn't we guarantee all IDs are int for parity with full channel objects?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or we could change both
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The library usually converts before passing in, so I think we should continue that
Co-authored-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> Signed-off-by: UK <41271523+NeloBlivion@users.noreply.github.com>
Summary
This was initially a PR to fix broken views sent in create_thread, but it turned out to be an underlying issue... once again with string IDs still being present in some areas of the library.
ForumChannel.create_thread
used the raw string ID for the ViewStore key, resulting in it always failing to resolve. Instead of castingint
here, I opted to forcePartialMessage
andPartialMessageable
to always convert toint
.Information
examples, ...).
Checklist
type: ignore
comments were used, a comment is also left explaining why.