bug(silo): SSE URL double /api/ and SiloOrigin command invocation #84

Closed
opened 2026-02-09 04:52:43 +00:00 by forbes · 0 comments
Owner

Bugs

1. SSE listener connects to wrong URL (reconnection loop)

SiloEventListener._listen() constructs the SSE endpoint as:

url = f"{_get_api_url().rstrip('/')}/api/events"

But _get_api_url() already returns a URL ending in /api (e.g., http://localhost:8080/api), producing http://localhost:8080/api/api/events. The server returns a non-event-stream response, which hits EOF immediately, triggering reconnection.

The diagnostic _test_sse() correctly uses /events (not /api/events).

Fix: Change /api/events to /events in _listen().

2. SiloOrigin.openDocument() calls cmd.Activated() on C++ wrapper

silo_origin.py lines 325-327 and 357-359 use:

cmd = FreeCADGui.Command.get("Silo_Open")
cmd.Activated()

FreeCADGui.Command.get() returns the C++ Gui::Command wrapper, which does not expose .Activated(). The correct API is FreeCADGui.runCommand("Silo_Open").

Fix: Replace cmd.Activated() calls with FreeCADGui.runCommand().

## Bugs ### 1. SSE listener connects to wrong URL (reconnection loop) `SiloEventListener._listen()` constructs the SSE endpoint as: ```python url = f"{_get_api_url().rstrip('/')}/api/events" ``` But `_get_api_url()` already returns a URL ending in `/api` (e.g., `http://localhost:8080/api`), producing `http://localhost:8080/api/api/events`. The server returns a non-event-stream response, which hits EOF immediately, triggering reconnection. The diagnostic `_test_sse()` correctly uses `/events` (not `/api/events`). **Fix:** Change `/api/events` to `/events` in `_listen()`. ### 2. SiloOrigin.openDocument() calls cmd.Activated() on C++ wrapper `silo_origin.py` lines 325-327 and 357-359 use: ```python cmd = FreeCADGui.Command.get("Silo_Open") cmd.Activated() ``` `FreeCADGui.Command.get()` returns the C++ `Gui::Command` wrapper, which does not expose `.Activated()`. The correct API is `FreeCADGui.runCommand("Silo_Open")`. **Fix:** Replace `cmd.Activated()` calls with `FreeCADGui.runCommand()`.
forbes added the bug label 2026-02-09 04:52:43 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kindred/create#84