dashboard: honor deploy-time API base for live metrics stream (thanks @porkmagus) #96

Merged
jcoffey-dev merged 3 commits from fix/live-metrics-api-base into main 2026-10-09 07:23:09 +00:00
Owner

Ported from GitHub inbuxa/inbuxa-admin#8 by porkmagus (https://github.com/porkmagus) — thank you! Their commit e4dcb70 is merged unchanged, so the authorship is theirs.

The bug: in split deployments (Admin in Docker pointed at the server through API_BASE_URL / the api-base-url meta tag), the dashboard's live-metrics EventSource was built from window.location.origin. It reached the Admin nginx instead of the server, got the SPA shell back, and live metrics silently stopped. Every other /api/live caller already used getApiBaseUrl(); liveMetricsStore.getOrigin() was the only one that didn't.

The fix (porkmagus): getOrigin() delegates to the shared getApiBaseUrl(). Same-origin deployments behave exactly as before. A regression test covers both cases.

On top: one commit of mine adds the AGPL modification notice to liveMetricsStore.ts, since this is the first change to that upstream-derived file.

Checked locally: npm ci, typecheck, lint, i18n:check, notice check, 650 tests, build.

Ported from GitHub inbuxa/inbuxa-admin#8 by **porkmagus** (https://github.com/porkmagus) — thank you! Their commit e4dcb70 is merged unchanged, so the authorship is theirs. **The bug:** in split deployments (Admin in Docker pointed at the server through API_BASE_URL / the `api-base-url` meta tag), the dashboard's live-metrics EventSource was built from `window.location.origin`. It reached the Admin nginx instead of the server, got the SPA shell back, and live metrics silently stopped. Every other `/api/live` caller already used `getApiBaseUrl()`; `liveMetricsStore.getOrigin()` was the only one that didn't. **The fix (porkmagus):** `getOrigin()` delegates to the shared `getApiBaseUrl()`. Same-origin deployments behave exactly as before. A regression test covers both cases. **On top:** one commit of mine adds the AGPL modification notice to `liveMetricsStore.ts`, since this is the first change to that upstream-derived file. Checked locally: npm ci, typecheck, lint, i18n:check, notice check, 650 tests, build.
jcoffey-dev added 3 commits 2026-10-09 07:21:19 +00:00
dashboard: add the modification notice to liveMetricsStore.ts
ci / build (pull_request) Skipped
ci / publish (pull_request) Skipped
ci / notices (pull_request) Successful in 46s
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 1m42s
0c5ddeaf98
The live-metrics fix is the first change to this upstream-derived file, so it
now carries the AGPL modification notice the notice check requires.
jcoffey-dev merged commit 5d88203c7e into main 2026-10-09 07:23:09 +00:00
jcoffey-dev deleted branch fix/live-metrics-api-base 2026-10-09 07:23:09 +00:00
Sign in to join this conversation.