vp migrate beta test#4
Conversation
There was a problem hiding this comment.
Code Review
This pull request primarily applies formatting and style updates across multiple files, including Elysia examples, Turnstile Spin worker templates, and server modules, alongside updating dependencies for Vite and Vitest. A critical bug was identified in packages/server/app/infrastructure/d1/database.ts where the first function signature is missing the db: D1Database parameter, which will lead to runtime errors since callers pass the database instance as the first argument.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| sql: string, | ||
| ...values: unknown[] | ||
| ): Promise<T | null> => { | ||
| const row = await db.prepare(sql).bind(...values).first<Record<string, unknown>>() | ||
| const row = await db |
There was a problem hiding this comment.
在 first 函数的定义中缺少了 db: D1Database 参数,但其所有的调用处(例如 auth.repository.ts 和 sync.repository.ts)都将 this.db 作为第一个参数传入。这会导致传入的数据库对象被当作 SQL 查询字符串,而真正的 SQL 字符串被绑定到 values 数组中,从而引发运行时错误。请在 first 函数的签名中添加 db: D1Database 参数,使其与 all 和 run 保持一致。
| sql: string, | |
| ...values: unknown[] | |
| ): Promise<T | null> => { | |
| const row = await db.prepare(sql).bind(...values).first<Record<string, unknown>>() | |
| const row = await db | |
| db: D1Database, | |
| sql: string, | |
| ...values: unknown[] | |
| ): Promise<T | null> => { | |
| const row = await db |
描述
关联 Issue
解决的问题
测试情况
截屏
变更的类型
检查