You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I couldn't find any kind of schema validation related to the sending/receiving of messages, if I'm not mistaken it looks like we could KeyError here. I think the solution would be more robust if we type-hinted all this, as any value retrieved from data is not typed and therefore cannot be type checked.
This impacts not only this method, but every method where any message is sent or received. I know it's not a small change, but in my opinion this is important and affects long term maintainability, as currently there's no easy way to perform refactors like changing/adding/removing attributes to the message schemas, as there are no static type checking guarantees.
We could leverage pydantic models and validations to tie messages to well defined schemas, like I did for reliable integration websocket messages, for example.
I couldn't find any kind of schema validation related to the sending/receiving of messages, if I'm not mistaken it looks like we could
KeyError
here. I think the solution would be more robust if we type-hinted all this, as any value retrieved from data is not typed and therefore cannot be type checked.This impacts not only this method, but every method where any message is sent or received. I know it's not a small change, but in my opinion this is important and affects long term maintainability, as currently there's no easy way to perform refactors like changing/adding/removing attributes to the message schemas, as there are no static type checking guarantees.
We could leverage pydantic models and validations to tie messages to well defined schemas, like I did for reliable integration websocket messages, for example.
Originally posted by @glevco in #275 (comment)
The text was updated successfully, but these errors were encountered: