From df9e2ac1c3e0db74084daa4ee6b72f5c21f79ae1 Mon Sep 17 00:00:00 2001 From: AAGaming Date: Fri, 10 Nov 2023 16:57:50 -0500 Subject: [PATCH] change default event DataType --- backend/src/wsrouter.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/src/wsrouter.py b/backend/src/wsrouter.py index 28e3e9258..b5ed3c2bf 100644 --- a/backend/src/wsrouter.py +++ b/backend/src/wsrouter.py @@ -132,7 +132,8 @@ async def handle(self, request: Request): self.logger.debug('Websocket connection closed') return ws - async def emit(self, event: str, data: DataType | None = None, data_type: Type[DataType] = Any): + # DataType defaults to None so that if a plugin opts in to strict pyright checking and attempts to pass data witbout specifying the type (or any), the type check fails + async def emit(self, event: str, data: DataType | None = None, data_type: Type[DataType] = None): self.logger.debug('Firing frontend event %s with args %s', data) - await self.write({ "type": MessageType.EVENT.value, "event": event, "data": data }) \ No newline at end of file + await self.write({ "type": MessageType.EVENT.value, "event": event, "data": data })