You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(app): stream live server logs to the management UI via SSE (#45)
Closes#43
Adds a real-time log tail to the Logs panel:
- LogsService.streamLogs(game, signal) – AsyncGenerator that polls
FilterLogEvents every 2 s, de-duplicates by eventId, advances
startTime on each tick, and exits cleanly when the AbortSignal fires.
Queries the whole log group so task stop+start (new stream) is handled
automatically.
- GET /api/logs/:game/stream – @sse() endpoint wrapping the generator
in an RxJS Observable. Teardown aborts the generator when the client
disconnects.
- ApiTokenGuard – falls back to ?token= query param when the
Authorization header is absent, which is necessary because the
browser's native EventSource cannot set custom headers.
- LogsPanel.tsx – fetches a snapshot on game change then opens an
EventSource stream that appends new lines (capped at 1 000). Pause
buffers incoming lines; Resume flushes the buffer. Replaces the old
manual Refresh button.
- LogsService.test.ts – seven new streamLogs cases covering clean
termination, multi-poll delivery, de-duplication, log-group naming,
error recovery, and missing message fields.
- docs/components/management-app.md – updated endpoint table, Live Logs
description, auth notes, and LogsService blurb.
IAM: logs:* already covers FilterLogEvents (docs/setup.md unchanged).
https://claude.ai/code/session_01THkoGDYjJhojhtnUEYi4w9
---------
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CLAUDE.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -154,6 +154,7 @@ Any time you add or remove Terraform variables, update **all four** of these in
154
154
-**Always use `/pr` to create pull requests.** The `.claude/commands/pr.md` skill validates the title format before calling the API. Never call `mcp__github__create_pull_request` directly without running this check first.
155
155
-**PR titles MUST use Conventional Commits.** We squash-merge, so the PR title becomes the commit subject on `main` verbatim — a badly-formed title produces a badly-formed commit that can't be fixed after merge. Format: `<type>(<optional-scope>): <imperative summary>`, where `<type>` is one of `feat`, `fix`, `refactor`, `docs`, `test`, `chore`, `perf`, `build`, `ci`, `style`. Keep the subject under ~70 characters; put details in the PR body. Examples: `refactor(app): migrate server from Express+tsyringe to Nest.js`, `docs: reflect Nest.js migration in CLAUDE.md`, `fix(watchdog): stop leaking tags on failed runs`, `chore: add ESLint flat config`.
156
156
-**Pre-flight check (mandatory):** before any `create_pull_request` call, verify the title matches `^(feat|fix|refactor|docs|test|chore|perf|build|ci|style)(\([^)]+\))?: .+$`. If it doesn't, fix it first. `Add ESLint configuration` fails (no type prefix); `chore: add ESLint configuration` passes.
157
+
-**Always include `Closes #N`** in the PR body when the PR resolves a GitHub issue. Place it as the first line so GitHub auto-closes the issue on merge.
0 commit comments