Streaming Init Report (SSE)
Overview
Config reload now streams the init report in real time via Server-Sent Events (SSE), so each source appears in the UI as soon as it is processed — instead of waiting for the entire init to complete.
How it works
- The frontend calls
POST /config/reload-streamusing@microsoft/fetch-event-source. - The backend
initStream()AsyncGenerator yields one chunk per source. - The config validation result appears immediately before webhook init starts.
- The full report is persisted once at the end (no partial writes).
- The old
POST /config/reloadendpoint is removed.
Key files
src/protocol/source/source.service.ts—initStream()AsyncGeneratorsrc/app.controller.ts—POST /config/reload-stream+calculateStatusui/src/protocol/tower.api.ts—reloadConfigStream()withfetchEventSourceui/src/pages/settings/Status.tsx— Streaming reload, guard ref for React StrictMode
Technical decisions
- Report is written once at the end to avoid partial/inconsistent state on disk.
- Demo mode detects the mock path and uses
mockReloadStream(simulates SSE with progressive delays) instead of realfetchEventSource. - A guard ref in
Status.tsxprevents React StrictMode double-render from triggering two concurrent reload streams.