Skip to content

Commit b41b1f3

Browse files
Lendemormasenf
authored andcommitted
fix mutable default in EventNamespace (#4420)
1 parent 9ebf16c commit b41b1f3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

reflex/app.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,10 +1462,10 @@ class EventNamespace(AsyncNamespace):
14621462
app: App
14631463

14641464
# Keep a mapping between socket ID and client token.
1465-
token_to_sid: dict[str, str] = {}
1465+
token_to_sid: dict[str, str]
14661466

14671467
# Keep a mapping between client token and socket ID.
1468-
sid_to_token: dict[str, str] = {}
1468+
sid_to_token: dict[str, str]
14691469

14701470
def __init__(self, namespace: str, app: App):
14711471
"""Initialize the event namespace.
@@ -1475,6 +1475,8 @@ def __init__(self, namespace: str, app: App):
14751475
app: The application object.
14761476
"""
14771477
super().__init__(namespace)
1478+
self.token_to_sid = {}
1479+
self.sid_to_token = {}
14781480
self.app = app
14791481

14801482
def on_connect(self, sid, environ):

0 commit comments

Comments
 (0)