Skip to content

test(builds): cast the env DB before binding batch - #834

Merged
stamp-build[bot] merged 1 commit into
mainfrom
agent/tsc-fix-only
Oct 29, 2026
Merged

stamp-build[bot] merged 1 commit into
mainfrom
agent/tsc-fix-only

Conversation

@stamp-build

@stamp-build stamp-build Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Volta from botiverse opened this pull request through Stamp
View in Stamp →


Problem

Main does not type-check. The deploy gate failed with:

test/routes.test.ts(10401,30): error TS2339: Property 'batch' does not exist on type '{ prepare: (sql: string) => any; }'

The batch shims added with #832 call env.DB.batch, but makeEnv() types the database as { prepare } only. Vitest does not run these checks, so the suites were green while the worker build was red.

This replaces #833, whose branch still carried the pre-squash commits from #832 and therefore conflicted; this is the same change as a single commit on current main.

Changes

Cast through D1Database before binding batch, following the existing feedback-commit shim in the same file. Two lines, no behaviour change.

Testing

  • tsc --noEmit reports nothing on those lines.
  • Worker suite 1201 passed.

Follow-up

Worth stating because it cost a failed deploy: worker-tests.yml documents that the worker type-check is deliberately not run at pull-request time — it needs worker-configuration.d.ts generated from the rendered production config. So a green PR is not evidence that main builds for worker/src or worker/test changes; the deploy gate is the only check, which means dispatching a deploy soon after merge is what surfaces a type error.

Codex suggested closing that gap in PR CI by generating wrangler types from a placeholder config and then running tsc --noEmit. Two type errors today (TS2532, then this one) were both found only at deploy time, so that step would have caught both.

Rebased onto main as a single change: #832 squash-merged the behaviour fix, so only the
type correction remains. makeEnv() types DB as { prepare }, so env.DB.batch fails TS2339
and the worker build stops at Run checks. Cast through D1Database, following the existing
feedback-commit shim in the same file.

No behaviour change. tsc clean on those lines; worker suite 1201 passed.
@stamp-build
stamp-build Bot merged commit 7412932 into main Oct 29, 2026
11 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.

0 participants