Repository navigation
fix: repair the frontend type build and check it in CI - #6
Merged
Merged
Conversation
`npm run build` (tsc -b && vite build) has been failing on dev: the `streamOwnerByAddress` map's value type and `registerStreamOwner`'s parameter type were two hand-maintained copies of the same union, and only the parameter gained "scope_collection_stream", so every call to `.set()` was a type error. The map already held those values at runtime -- only the type was wrong. Declare the union once as `StreamOwnerKind`/`StreamOwner` and use it in both places, which fixes the errors and removes the drift that caused them. Nothing in CI ran `tsc`: vitest strips types without checking them, and the e2e suite serves the app with `vite dev`, which does the same. Build the frontend in the unit-tests job so the next type error is caught here rather than by whoever next runs a release build. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The dashboard serves `src/ezmsg/dashboard/_web`, a committed copy of `frontend/dist`, and nothing verified the two agreed. They had been out of sync since the relay rendering work, so the packaged dashboard served a bundle months older than the source -- `npm run build` alone does not update it. `build_frontend --check` already existed for exactly this; run it right after the build step added in this branch, with the fix spelled out in the failure message. Requires `uv sync` because importing the package pulls in FastAPI. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
cboulay
force-pushed
the
fix/frontend-typecheck
branch
from
August 14, 2026 18:56
4c23007 to
df91ca3
Compare
This was referenced Aug 14, 2026
cboulay
added a commit
that referenced
this pull request
Aug 14, 2026
Rebuilt so `src/ezmsg/dashboard/_web` carries the settings-channel filter. The staleness check added in #6 is now on dev and fails without this, which is exactly the drift it was added to catch. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #5 (base is
fix/nonfinite-float-settings), so the diff here is just the two files below.npm run buildwas broken ondevstreamOwnerByAddress's value type andregisterStreamOwner's parameter type were two hand-maintained copies of the same union, and only the parameter ever gained"scope_collection_stream". So both.set()calls inregisterStreamOwnerwere type errors.Only the type was wrong — the map has always held
"scope_collection_stream"owners at runtime, and both consumers (ownerKind !== "orphan"at the orphan-node loop, and the explicit list innodeIdForStream) already behave correctly for them. Declaring the union once asStreamOwnerKind/StreamOwnerfixes the errors and removes the drift that caused them.Why CI never caught it
Nothing in CI runs
tsc.viteststrips types without checking them, and the e2e suite serves the app withvite dev(seeplaywright.config.tswebServer), which does the same. The production build is the only thing that typechecks, so this adds anpm run buildstep to theunit-testsjob.Verification
npm run build: passes (tsc -bclean, vite emits 215 modules).npm test: 35 passed.npm run test:e2e: 24 passed, including the topology visual baselines — the rendering is unchanged, as expected for a type-only fix.Also: catch stale packaged frontend assets (second commit)
The same blind spot in a different form. The server serves
src/ezmsg/dashboard/_web, a committed copy offrontend/dist, and nothing verified the two agreed — they had drifted by months, so the packaged dashboard served a bundle far older than the source.build_frontend --checkalready existed for exactly this; it now runs right after the build step above, with the fix spelled out in the failure message. It needsuv syncbecause importing the package pulls in FastAPI.Verified both ways: the check passes on this branch, and mutating one byte of
_web/index.htmlmakes it exit 1.No asset commit was needed here — this branch's change is type-only, so the emitted bundle is byte-identical to the one refreshed in #5.
🤖 Generated with Claude Code