pulse-framework 0.1.68a1__py3-none-any.whl → 0.1.69__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pulse/render_session.py +16 -1
- {pulse_framework-0.1.68a1.dist-info → pulse_framework-0.1.69.dist-info}/METADATA +1 -1
- {pulse_framework-0.1.68a1.dist-info → pulse_framework-0.1.69.dist-info}/RECORD +5 -5
- {pulse_framework-0.1.68a1.dist-info → pulse_framework-0.1.69.dist-info}/WHEEL +0 -0
- {pulse_framework-0.1.68a1.dist-info → pulse_framework-0.1.69.dist-info}/entry_points.txt +0 -0
pulse/render_session.py
CHANGED
|
@@ -258,6 +258,7 @@ class RenderSession:
|
|
|
258
258
|
_pending_api: dict[str, asyncio.Future[dict[str, Any]]]
|
|
259
259
|
_pending_js_results: dict[str, asyncio.Future[Any]]
|
|
260
260
|
_global_states: dict[str, State]
|
|
261
|
+
_global_queue: list[ServerMessage]
|
|
261
262
|
_tasks: TaskRegistry
|
|
262
263
|
_timers: TimerRegistry
|
|
263
264
|
|
|
@@ -283,6 +284,7 @@ class RenderSession:
|
|
|
283
284
|
self._client_address = client_address
|
|
284
285
|
self._send_message = None
|
|
285
286
|
self._global_states = {}
|
|
287
|
+
self._global_queue = []
|
|
286
288
|
self.query_store = QueryStore()
|
|
287
289
|
self.connected = False
|
|
288
290
|
self.channels = ChannelsManager(self)
|
|
@@ -319,6 +321,10 @@ class RenderSession:
|
|
|
319
321
|
"""WebSocket connected. Set sender, don't auto-flush (attach does that)."""
|
|
320
322
|
self._send_message = send_message
|
|
321
323
|
self.connected = True
|
|
324
|
+
if self._global_queue:
|
|
325
|
+
for msg in self._global_queue:
|
|
326
|
+
send_message(msg)
|
|
327
|
+
self._global_queue = []
|
|
322
328
|
|
|
323
329
|
def disconnect(self):
|
|
324
330
|
"""WebSocket disconnected. Start queuing briefly before pausing."""
|
|
@@ -333,11 +339,20 @@ class RenderSession:
|
|
|
333
339
|
|
|
334
340
|
def send(self, message: ServerMessage):
|
|
335
341
|
"""Route message based on mount state."""
|
|
342
|
+
# Global messages (not path-specific, or navigate_to) bypass mount state.
|
|
343
|
+
if message.get("type") == "navigate_to":
|
|
344
|
+
if self._send_message:
|
|
345
|
+
self._send_message(message)
|
|
346
|
+
else:
|
|
347
|
+
self._global_queue.append(message)
|
|
348
|
+
return
|
|
336
349
|
# Global messages (not path-specific) go directly if connected
|
|
337
350
|
path = message.get("path")
|
|
338
351
|
if path is None:
|
|
339
352
|
if self._send_message:
|
|
340
353
|
self._send_message(message)
|
|
354
|
+
else:
|
|
355
|
+
self._global_queue.append(message)
|
|
341
356
|
return
|
|
342
357
|
|
|
343
358
|
# Normalize path for lookup
|
|
@@ -441,7 +456,6 @@ class RenderSession:
|
|
|
441
456
|
|
|
442
457
|
if mount is None or mount.state == "idle":
|
|
443
458
|
# Initial render must come from prerender
|
|
444
|
-
print(f"[DEBUG] Missing or idle route '{path}', reloading")
|
|
445
459
|
self.send({"type": "reload"})
|
|
446
460
|
return
|
|
447
461
|
|
|
@@ -583,6 +597,7 @@ class RenderSession:
|
|
|
583
597
|
if not fut.done():
|
|
584
598
|
fut.cancel()
|
|
585
599
|
self._pending_js_results.clear()
|
|
600
|
+
self._global_queue = []
|
|
586
601
|
self._send_message = None
|
|
587
602
|
self.connected = False
|
|
588
603
|
|
|
@@ -88,7 +88,7 @@ pulse/queries/store.py,sha256=4pWTDSl71LUM7YqhWanKjZkFh3t8F_04o48js_H4ttQ,3728
|
|
|
88
88
|
pulse/react_component.py,sha256=8RLg4Bi7IcjqbnbEnp4hJpy8t1UsE7mG0UR1Q655LDk,2332
|
|
89
89
|
pulse/reactive.py,sha256=GSh9wSH3THCBjDTafwWttyx7djeKBWV_KqjaKRYUNsA,31393
|
|
90
90
|
pulse/reactive_extensions.py,sha256=yQ1PpdAh4kMvll7R15T72FOg8NFdG_HGBsGc63dawYk,33754
|
|
91
|
-
pulse/render_session.py,sha256=
|
|
91
|
+
pulse/render_session.py,sha256=RJgxJp_yRpDBr3l9ZFW0Eb6-dSp_urTzzPhPcHd0_Vo,23224
|
|
92
92
|
pulse/renderer.py,sha256=fjSsUvCqV12jyN7Y5XspKUfjQJJzKX-Chha5oF5PrAk,16001
|
|
93
93
|
pulse/request.py,sha256=N0oFOLiGxpbgSgxznjvu64lG3YyOcZPKC8JFyKx6X7w,6023
|
|
94
94
|
pulse/requirements.py,sha256=nMnE25Uu-TUuQd88jW7m2xwus6fD-HvXxQ9UNb7OOGc,1254
|
|
@@ -122,7 +122,7 @@ pulse/types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
122
122
|
pulse/types/event_handler.py,sha256=psQCydj-WEtBcFU5JU4mDwvyzkW8V2O0g_VFRU2EOHI,1618
|
|
123
123
|
pulse/user_session.py,sha256=nsnsMgqq2xGJZLpbHRMHUHcLrElMP8WcA4gjGMrcoBk,10208
|
|
124
124
|
pulse/version.py,sha256=711vaM1jVIQPgkisGgKZqwmw019qZIsc_QTae75K2pg,1895
|
|
125
|
-
pulse_framework-0.1.
|
|
126
|
-
pulse_framework-0.1.
|
|
127
|
-
pulse_framework-0.1.
|
|
128
|
-
pulse_framework-0.1.
|
|
125
|
+
pulse_framework-0.1.69.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
|
|
126
|
+
pulse_framework-0.1.69.dist-info/entry_points.txt,sha256=i7aohd3QaPu5IcuGKKvsQQEiMYMe5HcF56QEsaLVO64,46
|
|
127
|
+
pulse_framework-0.1.69.dist-info/METADATA,sha256=X4vr-LRgEilEvL7pxzvDIz-mY7gq85oU6nVjaDILngc,8300
|
|
128
|
+
pulse_framework-0.1.69.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|