Skip to content

e2e wire fixture duplicates the batch-action roster untyped — the type system can only see one copy #358

Description

@JArmandoAnaya

What happened (found during #356)

Withdrawing BatchAction.DELETE (#331) revealed two transcriptions of the batch action table:

  • frontend/ui-core/src/testing/wire.fixtures.ts — typed BatchAction; removing the member
    was an instant tsc error.
  • frontend/app/e2e/_wire.ts — typed readonly string[]; compiled clean and kept serving
    "delete".

The generated checks.ts rejected the stale payload inside a hook, which doesn't raise — the
query never resolves, and every gallery spec failed with element(s) not found and 20-second
timeouts reading as a UI regression. All 2590 pytest, both vitest suites, mypy, ruff,
lint-imports, generate:client:check and typecheck:e2e were green with the broken fixture in
place. Only the browser suite could see it, and it pointed nowhere near the cause.

Values were fixed in #356; the structural gap was not (recorded there under "Found, not fixed").

Why it wasn't fixed inline

Typing _wire.ts against the real roster means importing from @visionset/ui-core internals,
and the package exports only its root — typing the fixture widens the public API, which is a
decision, not a diff.

Options

  1. Export a @visionset/ui-core/testing subpath carrying the wire fixtures and their types;
    _wire.ts imports and narrows. Widens the API deliberately, kills the second roster.
  2. Generate _wire.ts from the same source as wire.fixtures.ts (the generated/ client
    already sets the precedent: regenerate, never hand-edit).
  3. A comparison test asserting the two rosters agree — cheapest, keeps both copies, and
    turns the silent drift into a named red test.

Whichever lands, the acceptance test is the same: re-adding "delete" to _wire.ts alone must
turn a named check red before any browser spec runs.

cf. #331, #356.

Metadata

Metadata

Assignees

No one assigned

    Labels

    frontendannotator / ui-core / app packagestoolingDeveloper tooling: scripts, checks, local workflowui-corefrontend/ui-core work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions