Skip to content

Commit 5631f83

Browse files
authored
Fix XY namespace activation with Reflex 0.10 (#527)
1 parent 72a069f commit 5631f83

7 files changed

Lines changed: 519 additions & 0 deletions

File tree

‎news/526.bugfix.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Connect the XY chart namespace explicitly when Reflex 0.10 pre-creates the shared Socket.IO manager with auto-connect disabled, restoring live chart rendering.

‎package-lock.json‎

Lines changed: 301 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
},
99
"devDependencies": {
1010
"playwright": "1.61.1",
11+
"socket.io": "4.8.4",
12+
"socket.io-client": "4.8.4",
1113
"typescript": "^7.0.2",
1214
"vite": "^8.1.5"
1315
},

‎python/reflex_xy/assets/XYChart.jsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ function xySocket() {
8383
});
8484
sharedSocket.on("connect", () => dbg("xy namespace connected"));
8585
sharedSocket.on("connect_error", (e) => dbg("xy connect_error", String(e)));
86+
// Reflex 0.10 pre-creates the shared manager with autoConnect: false.
87+
// Activate this namespace explicitly; io() inherits the manager's setting
88+
// even when the app plane has already opened its transport. An active
89+
// legacy socket may already have its CONNECT packet in flight.
90+
if (!sharedSocket.active) sharedSocket.connect();
8691
return sharedSocket;
8792
}
8893

0 commit comments

Comments
 (0)