Skip to content

fix(bridge): resolve type errors in bridge-sandbox-e2e suite#409

Merged
islandbitcoin merged 1 commit into
tmp/bridge-rebase-pr-readyfrom
fix/bridge-sandbox-e2e-types
Jun 17, 2026
Merged

fix(bridge): resolve type errors in bridge-sandbox-e2e suite#409
islandbitcoin merged 1 commit into
tmp/bridge-rebase-pr-readyfrom
fix/bridge-sandbox-e2e-types

Conversation

@islandbitcoin

Copy link
Copy Markdown
Contributor

Resolves the Check Code (tsc) failures surfaced once CI began running on the integration branch. The test/flash/bridge-sandbox-e2e/ suite was never type-checked while Actions was disabled, so type errors accumulated. Test-only changes — no production code touched. Fixes ENG-423.

Changes

  • helpers.ts — mock req/res casts (TS2352): the inject helpers cast createReqRes()'s generic objects straight to the Express handler param types. Route them through as unknown as … (TS's own suggestion).
  • helpers.tsexecQuery (TS2339): made generic (<T = Record<string, unknown>>, backward-compatible default) so call sites can type the GraphQL payload.
  • helpers.tsHandlerResponse.body (TS18046): typed as Record<string, unknown> instead of unknown (defaulting to {} in the inject returns), which fixes .body access in deposit-withdrawal.spec and external-account.spec without per-site casts.
  • cutover-state.spec.ts: type the execQuery result and narrow the error union (if ("errors" in response) throw …) before asserting.

Validation caveat

  • I could not run tsc locally (no install in my environment), so this is analysis-validated against the exact errors tsc reported. CI is the real check.
  • This PR won't show checks until ci: run checks on the bridge-rebase integration branch #408 merges — the integration-branch CI trigger isn't active yet, so PRs into tmp/bridge-rebase-pr-ready don't run workflows. Either merge ci: run checks on the bridge-rebase integration branch #408 first, or validate this alongside it.
  • Scoped strictly to Check Code / the e2e suite. The other red checks (Redis service, integration config, vendir, bats) are separate infra issues tracked in ENG-422.

🤖 Generated with Claude Code

The Bridge sandbox e2e suite never passed through tsc (CI was disabled),
so type errors accumulated and now fail Check Code. All test-only:

- helpers.ts: route mock req/res through 'unknown' before casting to the
  Express handler param types (TS2352).
- execQuery: make generic (default Record<string, unknown>, backward
  compatible) so callers can type the GraphQL payload (TS2339).
- HandlerResponse.body: type as Record<string, unknown> instead of
  unknown, fixing .body access in the deposit/external-account specs
  without per-site casts (TS18046).
- cutover-state.spec: type the execQuery result and narrow the error
  union before asserting.

No production code touched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@linear

linear Bot commented Jun 17, 2026

Copy link
Copy Markdown

ENG-423

@islandbitcoin islandbitcoin marked this pull request as ready for review June 17, 2026 21:49
@islandbitcoin islandbitcoin merged commit 1967135 into tmp/bridge-rebase-pr-ready Jun 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant