Private
Public Access
0
0

Revert "merge: tier2/phase2_4_5_call_site_completion_20260621 (parent + follow-up + Phase 6e analysis)"

This reverts commit f914b2bcd4, reversing
changes made to 7fef95cc87.
This commit is contained in:
2026-06-21 22:39:14 -04:00
parent f32e4fd268
commit 751b94d4e8
81 changed files with 2683 additions and 5005 deletions
+6 -14
View File
@@ -10,17 +10,9 @@ import uuid
# TODO(Ed): Eliminate these?
from http.server import ThreadingHTTPServer, BaseHTTPRequestHandler
from typing import Any
from dataclasses import dataclass
from src.module_loader import _require_warmed
from src.result_types import ErrorInfo, ErrorKind, Result
from src.type_aliases import JsonValue
@dataclass(frozen=True)
class WebSocketMessage:
channel: str
payload: JsonValue
"""
@@ -139,7 +131,7 @@ class HookServerInstance(ThreadingHTTPServer):
super().__init__(server_address, RequestHandlerClass)
self.app = app
def _serialize_for_api(obj: Any) -> JsonValue:
def _serialize_for_api(obj: Any) -> Any:
"""Serializes complex objects into API-friendly formats (dicts/lists)."""
if hasattr(obj, "to_dict"):
return obj.to_dict()
@@ -980,12 +972,12 @@ class WebSocketServer:
if self.thread:
self.thread.join(timeout=2.0)
def broadcast(self, message: WebSocketMessage) -> None:
def broadcast(self, channel: str, payload: dict[str, Any]) -> None:
"""
[C: src/app_controller.py:AppController._process_pending_gui_tasks, src/events.py:AsyncEventQueue.put, tests/test_websocket_server.py:test_websocket_subscription_and_broadcast]
"""
if not self.loop or message.channel not in self.clients:
if not self.loop or channel not in self.clients:
return
wire = json.dumps({"channel": message.channel, "payload": message.payload})
for ws in list(self.clients[message.channel]):
asyncio.run_coroutine_threadsafe(ws.send(wire), self.loop)
message = json.dumps({"channel": channel, "payload": payload})
for ws in list(self.clients[channel]):
asyncio.run_coroutine_threadsafe(ws.send(message), self.loop)